Skip to content

Instantly share code, notes, and snippets.

@avoidik
Last active Jan 25, 2021
Embed
What would you like to do?
ffmpeg encode mpeg2 ps and ts profiles
# with PCM 16-bit audio (uncompressed), constant video bitrate with specific bitrate tolerance
ffmpeg -i "input.mp4" \
  -c:v mpeg2video -pix_fmt yuv422p -refs 1 -bf 2 -b:v 50M -maxrate 50M -minrate 50M \
  -s 1920x1080 -aspect 16:9 \
  -c:a pcm_s16be -f vob \
  "output.mpg"
# with AC3 audio (Dolby Digital)
ffmpeg -i "input.mp4" \
  -c:v mpeg2video -b:v 20M -refs 1 -bf 0 -c:a ac3 -b:a 384k -async 1 -f vob \
  "output.mpg" 
# with MP3 audio (MPEG-1 Audio Layer 3)
ffmpeg -i "input.mp4" \
  -c:v mpeg2video -b:v 20M -c:a mp3 -b:a 192k -f vob \
  "output.mpg" 

ref. https://en.wikibooks.org/wiki/FFMPEG_An_Intermediate_Guide/MPEG

ref. https://trac.ffmpeg.org/wiki/Encode/MPEG-4

ref. https://trac.ffmpeg.org/wiki/Encode/H.264

ref. https://en.wikipedia.org/wiki/MPEG_program_stream

ref. https://en.wikipedia.org/wiki/MPEG_transport_stream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment