ffmpeg highest quality mp4 to mpg

12,674

Doesn't look like PP2010 supports H.264. (If it did, you could skip re-encoding altogether).

Try

ffmpeg -i video.mp4 -c:v mpeg2video -q:v 5 -c:a mp2 -f vob video.mpg

This will produce a MPEG-2 Program Stream container with MPEG-2 video and MP2 audio.

Share:
12,674
scopa
Author by

scopa

Updated on June 27, 2022

Comments

  • scopa
    scopa about 2 years

    I have a mp4 video that I need to convert to mpg (for windows PowerPoint2010)

    I have been trying to get best quality. But I keep getting error:

    [mpeg @ 0x2523620] buffer underflow st=0 bufi=420177 size=445860
    [mpeg @ 0x2523620] packet too large, ignoring buffer limits to mux it
    [mpeg @ 0x2523620] buffer underflow st=0 bufi=420177 size=445860
    [mpeg @ 0x2523620] buffer underflow st=0 bufi=422218 size=445860
    

    Could someone help me with the syntax for best quality ouput to mpg. Here is the output of the mp4 file:

    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
      Metadata:
        major_brand     : mp42
        minor_version   : 0
        compatible_brands: mp41isom
        creation_time   : 2016-06-10 11:15:06
      Duration: 00:04:20.86, start: 0.000000, bitrate: 18677 kb/s
        Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1920x1080, 18541 kb/s, 29.97 fps, 29.97 tbr, 29970 tbn, 59.94 tbc (default)
        Metadata:
          creation_time   : 2016-06-10 11:15:06
          handler_name    : VideoHandler
          encoder         : AVC Coding
        Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 132 kb/s (default)
        Metadata:
          creation_time   : 2016-06-10 11:15:06
          handler_name    : SoundHandler
    

    I have tried the following but keep getting that error:

    ffmpeg -i video.mp4 -c:v libx264 -c:a copy -qp 5 video.mpg
    ffmpeg -i video.mp4 -c:v libx264 -c:a copy -qscale:v 1 video.mpg
    ffmpeg -i video.mp4 -c:v libx264 -crf 0 -c:a copy -bf 2 -flags qprd -flags mv0 video.mpg
    ffmpeg -i video.mp4 -c:v libx264 -crf 0 -c:a copy video.mpg
    ffmpeg -i video.mp4 -c:v libx264 -preset slow -crf 5 -c:a copy video.mpg
    ffmpeg -i video.mp4 -c:v libx264 -preset slow -crf 5 -c:a copy -maxrate 11000k video.mpg
    ffmpeg -i video.mp4 -c:v libx264 -preset slow -crf 5 -c:a copy -maxrate 5000 -bufsize 11000 video.mpg
    

    Thanks,

  • scopa
    scopa over 6 years
    Thanks. I think that is the best quality I can get out of this.
  • scopa
    scopa over 6 years
    For WMV the video quality is horrible if I run this, any suggestions? ffmpeg -i test.mp4 -c:v wmv2 -b:v 1024k -c:a wmav2 -b:a 192k test1.wmv
  • scopa
    scopa over 6 years
    also tried to output it to AVI via -t test.mp4 -f avi -c:v huffyuv test.avi quality was very good but it took a 54MB mp4 and spit out a 4GB AVI
  • Gyan
    Gyan over 6 years
    For AVI, try ffmpeg -i video.mp4 -c:v mpeg4 -q:v 5 video.avi. You can tweak the q-value for quality/size tradeoff.