Answer the question
In order to leave comments, you need to log in
Rebuild container or encode FFMPEG?
I have a python script that encodes a video from webm format to mp4. The video should not change, and the question is, is it possible to somehow simply rebuild the container, and not encode each video frame by frame?
The code works through the library
https://github.com/kkroening/ffmpeg-python/blob/ma...
import ffmpeg
(
ffmpeg
.input('/var/development/decode_webm/1.webm')
.output('/var/development/webm_upload/1.mp4')
.run()
)
Answer the question
In order to leave comments, you need to log in
Most likely like this:
import ffmpeg
(
ffmpeg
.input('/var/development/decode_webm/1.webm')
.output('/var/development/webm_upload/1.mp4', vcodec=copy, acodec=copy)
.run()
)
you can run ffmpeg through subprocess and wait for execution.
https://docs.python.org/3/library/subprocess.html#...
check_call(['ffmpeg', '-v', 'warning', '-y', '-f', 'concat', '-i', input_path, '-c', 'copy', '-c:v', 'h264', '-c:a', 'mp2', '-preset', 'ultrafast', output_path])
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question