renatotn7 commited on
Commit
9e99859
·
1 Parent(s): c2c91b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -31,10 +31,12 @@ if uploaded_file is not None:
31
  height=0
32
  if vcap.isOpened():
33
  # get vcap property
34
- width = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH) # float `width`
35
- height = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT) # float `height`
36
 
37
  st.write(str(width)+"x"+str(height))
 
 
38
  @st.experimental_memo(suppress_st_warning=True)
39
  def chamada():
40
  percent_complete=0
@@ -50,9 +52,10 @@ def chamada():
50
  height=0
51
  if vcap.isOpened():
52
  # get vcap property
53
- width = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_WIDTH) # float `width`
54
- height = vcap.get(cv2.cv.CV_CAP_PROP_FRAME_HEIGHT) # float `height`
55
- os.system("ffmpeg -i inputvideo -compression_level 10 -pred mixed -pix_fmt rgb24 -sws_flags +accurate_rnd+full_chroma_int -s "+str(width)+"x"+str(height)+" -r 30 ./_input/imagem-%4d.png")
 
56
  percent_complete= percent_complete+ 30
57
  with col1:
58
  my_bar.progress(percent_complete )
@@ -84,7 +87,7 @@ def chamada():
84
  # with col1:
85
  # st.write("recompilando video")
86
  #ffmpeg -r 60 -f image2 -s 1920x1080 -i _output/restored_imgs/imagem-%4d.png -pix_fmt yuv420p ./videoSaida/output.mp4
87
- os.system("ffmpeg -y -r 30 -f image2 -i _output/restored_imgs/imagem-%4d.png -pix_fmt yuv420p ./videoSaida/output.mp4")
88
  os.system("ls ./videoSaida")
89
  #st.video("./videoSaida/output.mp4" )
90
  with col1:
 
31
  height=0
32
  if vcap.isOpened():
33
  # get vcap property
34
+ width = vcap.get(cv2.CV_CAP_PROP_FRAME_WIDTH) # float `width`
35
+ height = vcap.get(cv2..CV_CAP_PROP_FRAME_HEIGHT) # float `height`
36
 
37
  st.write(str(width)+"x"+str(height))
38
+ fps = vcap.get(cv2.CAP_PROP_FPS)
39
+ st.write(str(fps)+" fps")
40
  @st.experimental_memo(suppress_st_warning=True)
41
  def chamada():
42
  percent_complete=0
 
52
  height=0
53
  if vcap.isOpened():
54
  # get vcap property
55
+ width = vcap.get(cv2.CV_CAP_PROP_FRAME_WIDTH) # float `width`
56
+ height = vcap.get(cv2.CV_CAP_PROP_FRAME_HEIGHT) # float `height`
57
+ fps = vcap.get(cv2.CAP_PROP_FPS)
58
+ os.system("ffmpeg -i inputvideo -compression_level 10 -pred mixed -pix_fmt rgb24 -sws_flags +accurate_rnd+full_chroma_int -s "+str(width)+"x"+str(height)+" -r "+fps+" ./_input/imagem-%4d.png")
59
  percent_complete= percent_complete+ 30
60
  with col1:
61
  my_bar.progress(percent_complete )
 
87
  # with col1:
88
  # st.write("recompilando video")
89
  #ffmpeg -r 60 -f image2 -s 1920x1080 -i _output/restored_imgs/imagem-%4d.png -pix_fmt yuv420p ./videoSaida/output.mp4
90
+ os.system("ffmpeg -y -r "+fps+" -f image2 -i _output/restored_imgs/imagem-%4d.png -pix_fmt yuv420p ./videoSaida/output.mp4")
91
  os.system("ls ./videoSaida")
92
  #st.video("./videoSaida/output.mp4" )
93
  with col1: