re-encode video [closed]

asked 2016-06-06 03:29:28 -0600

Hi,

in my Python app I record a temporary video with fps being unpredictable when constructing the VideoWriter object. I use this one merely for collecting frames coming from some lengthy calculations. When done, I re-encode the temporary video to a new video with different fps in order to synchronize the video play length with the timestamp written to the video frames. Here is a snippet:

for i in np.arange(num_frames):
        _, frame = video_tmp.read()
        video_out.write( cv2.cvtColor(frame, cv2.COLOR_RGB2GRAY) )

where video_tmp is the temporary video and video_out is the video with different fps.

Basically, my questions are:

Is it possible to just 'set' the new fps without encoding again?

If not, could encoding be done not frame-wise but in parallel?

I'm aware of the possibility to call ffmpeg externally for re-encoding. I just hoped, I could do it with OpenCV somehow.

Thanks in advance...

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-19 15:50:46.959684