Skip to content

Instantly share code, notes, and snippets.

@wallace11
Last active January 14, 2020 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wallace11/a608365b3c68d6ef52e9cca05be39b45 to your computer and use it in GitHub Desktop.
Save wallace11/a608365b3c68d6ef52e9cca05be39b45 to your computer and use it in GitHub Desktop.

Extract bluray audio

ffmpeg -i VIDEO.m2ts -map 0:<stream> -acodec <pcm_s24le|libmp3lame> audio.<wav|mp3>

Copy chapters from one file to another

ffmpeg -i video_w_chapters.mp4 -i video.mp4 -map 1 -map_metadata 0 -c copy output.mp4

-map 1→ Select video.mp4 as source
-map_metadata 0→ Select video_w_chapters.mp4 as metadata (chapters) source

Duplicate frames /w wrong

Fixing to be 10fps

ffmpeg -i INPUT.flv -r 10 -vf "mpdecimate,setpts=N/(10*TB)" OUTPUT.mp4

N→ The count of the input frame for video or the number of consumed samples, not including the current frame for audio, starting from 0.
TB→ The timebase of the input timestamps.

source

  • View codecs ffmpeg -codecs
  • View codec info ffmpeg -h encoder=<encoder>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment