Created
August 20, 2015 03:00
-
-
Save benwilber/f8c82ced90d2ba0490c7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import av | |
from av import AV | |
video_codec_opts = {"moov": "start"} # put the moov header at the front of the file | |
audio_codec_opts = {'codec': 'libfdk_aac'} # default libfaac | |
with open("source.mov") as fd: | |
vid = AV(fd) | |
vid.resize(720, 480) | |
vid.transcode_video(av.H264, **video_codec_opts) | |
vid.transcode_audio(av.AAC, **audio_codec_opts) | |
vid.save("output.mp4") # or a file-like | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment