Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques Wrong aspect ratio when AVCHD converted to MP4

  • Wrong aspect ratio when AVCHD converted to MP4

    Posted by Johan Wadman on November 30, 2010 at 8:01 pm

    Hi!
    I have a video recorder from Sony producing AVCHD content and storing to memory card.
    It is stated to record at a 1080i.
    ffmpeg says that the original .mts-file is 1440×1080 with DAR 16:9 and PAR 4:3.
    ffmpeg –i 00001.MTS
    Input #0, mpegts, from '00001.MTS':
    Duration: 00:02:42.24, start: 1.000033, bitrate: 11531 kb/s
    Program 1
    Stream #0.0[0x1011]: Video: h264, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
    Stream #0.2[0x1200]: Subtitle: pgssub

    The .MTS-container and the AC3-audio is not supported on my Samsung TV.
    Therefore I am converting it with ffmpeg to MP4 container and mp3 audio.
    I do this with
    ffmpeg -i 00001.MTS -vcodec copy -acodec libmp3lame output.mp4
    ...
    Input #0, mpegts, from '00001.MTS':
    Duration: 00:02:42.24, start: 1.000033, bitrate: 11531 kb/s
    Program 1
    Stream #0.0[0x1011]: Video: h264, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], 50 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x1100]: Audio: ac3, 48000 Hz, stereo, s16, 256 kb/s
    Stream #0.2[0x1200]: Subtitle: pgssub
    File 'output.mp4' already exists. Overwrite ? [y/N] y
    Output #0, mp4, to 'output.mp4':
    Metadata:
    encoder : Lavf52.64.2
    Stream #0.0: Video: libx264, yuv420p, 1440x1080 [PAR 4:3 DAR 16:9], q=2-31, 50 tbn, 25 tbc
    Stream #0.1: Audio: libmp3lame, 48000 Hz, stereo, s16, 64 kb/s
    ...

    The only problem is that when played on the Samsung TV it is shown as 4:3 content. (People look taller and black areas on left-end and right-end sides.)
    My guess is that Samsung TV don’t care about the PAR 4:3 and uses PAR 1:1 instead.
    Then since 1440/1080 equals 4/3 this is what I get.
    So I believe I need to convert 1440×1080 DAR 16:9,PAR4:3 to 1920×1080 DAR 16:9, PAR 1:1 ?
    The question is then how do I do that with ffmpeg???
    Best regards Johan

    Marcin Ok replied 13 years, 5 months ago 3 Members · 3 Replies
  • 3 Replies
  • Michael Rampe

    December 1, 2010 at 1:42 am

    [johan wadman] “My guess is that Samsung TV don’t care about the PAR 4:3 and uses PAR 1:1 instead. So I believe I need to convert 1440×1080 DAR 16:9,PAR4:3 to 1920×1080 DAR 16:9, PAR 1:1 ?
    The question is then how do I do that with ffmpeg???”

    I agree. since the Samsung device is not respecting the container aspect flag, you will need to re-compress the stream instead of using -vcodec copy.

    As you have quite a high bitrate original, you will need to specify that.

    one pass example:
    ffmpeg -i 00001.MTS -vcodec libx264 -vpre medium -b 11000k -s 1920×1080 -aspect 16:9 -acodec libmp3lame -ab 256k output.mp4

    two pass example:
    ffmpeg -i 00001.MTS -vcodec libx264 -vpre medium_firstpass -b 11000k -bt 11000k -s 1920×1080 -aspect 16:9 -an -pass 1 /dev/null && ffmpeg -i 00001.MTS -vcodec libx264 -vpre medium -b 11000k -bt 11000k -s 1920×1080 -aspect 16:9 -acodec libmp3lame -ab 256k -pass 2 output.mp4

    Depending on the content, you should be able to get acceptable quality at a lower bitrate so do some experiments.

    Michael

  • Johan Wadman

    December 1, 2010 at 9:20 pm

    Hi!
    I just tested and now it is correctly displayed!
    Thanks Michael!
    /Johan

  • Marcin Ok

    March 2, 2013 at 11:38 am

    This is very helpful. Do you maybe also know how the command would look like to also convert 50p to 50i?

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy