Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Compression Techniques H264 Mp4 created by FFmpeg don’t react well in FCP whereas same spec files created in Episode react much better. Why

  • H264 Mp4 created by FFmpeg don’t react well in FCP whereas same spec files created in Episode react much better. Why

    Posted by Thomas Brender on May 2, 2010 at 9:57 pm

    Hi,

    I’m trying to automate an encoding process with ffmpeg.
    Everything runs smoothly, but the MP4 files (codec H264) do not react well when imported in Final Cut. To be precise, the playback is slow, then stops, while the audio still plays. When trying to manipulate the file on the timeline, it gets even slower.

    Here is a summary of the specs, given by MediaInfo Mac

    *** MediaInfo Mac // Plain text file report
    2010-05-02 23:50:01 +0200
    Information for File: PPT.1080.mp4

    General / Container Stream # 1
    Total Video Streams for this File -> 1
    Total Audio Streams for this File -> 1
    Video Codecs Used -> AVC
    Audio Codecs Used -> AAC LC
    File Format -> MPEG-4
    Play Time -> 48s 661ms
    Total File Size -> 71.5 MiB
    Total Stream BitRate -> 12.3 Mbps
    Encoded with -> Lavf52.61.0
    Video Stream # 1
    Codec (Human Name) -> AVC
    Codec (FourCC) -> avc1
    Codec Profile -> Main@L4.1
    Frame Width -> 1 920 pixels
    Frame Height -> 1 080 pixels
    Frame Rate -> 25.000 fps
    Total Frames -> 1216
    Display Aspect Ratio -> 16/9
    Scan Type -> Progressive
    Colorimetry -> 4:2:0
    Codec Settings (Summary) -> 2 Ref Frames
    QF (like Gordian Knot) -> 0.236
    Codec Settings (CABAC) -> No
    Video Stream Length -> 48s 640ms
    Video Stream BitRate -> 12.2 Mbps
    Video Stream BitRate (Nominal) -> 12.0 Mbps
    Video Stream BitRate Mode -> VBR
    Bit Depth -> 24 bits
    Video Stream Size -> 70.9 MiB (99%)
    Video Encoder -> x264 – core 94 r1564 a927654
    Video Encoder (Settings) -> cabac=0 / ref=2 / deblock=1:0:0 / analyse=0x1:0x111 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=3 / wpredb=1 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=12000 / ratetol=1.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00
    Video Stream Language -> English
    Date of Original Encoding -> UTC 1970-01-01 00:00:00
    Audio Stream # 1
    Codec -> AAC
    Codec (FourCC) -> 40
    Audio Stream Length -> 48s 661ms
    Audio Stream BitRate -> 104 Kbps
    Audio Stream BitRate Mode -> VBR
    Number of Audio Channels -> 2
    Audio Channel’s Positions -> L R
    Sampling Rate -> 48.0 KHz
    Bit Depth -> 16 bits
    Audio Stream Size -> 619 KiB (1%)
    Audio Stream Language -> English
    Date of Original Encoding -> UTC 1970-01-01 00:00:00

    I know, H264 is not great to edit, but when I encode the same MP4 files in H264 with Episode, it works much better…

    Does anyone have an explanation ?

    Michael Rampe replied 16 years, 2 months ago 2 Members · 5 Replies
  • 5 Replies
  • Michael Rampe

    May 3, 2010 at 12:58 am

    [Thomas Brender] “I know, H264 is not great to edit”

    Correct. Why not use an edit friendly format?

    [Thomas Brender] “but when I encode the same MP4 files in H264 with Episode, it works much better…”

    Can you post the media info result for this file?

    Also, can you post the command line you are using in FFmpeg?

    [Thomas Brender] “Codec Profile -> Main@L4.1”

    I would like to know why you are not using high profile….

    Michael

    “half-way to world domination A.K.A. the belligerent blue bike shed”

  • Thomas Brender

    May 3, 2010 at 8:43 pm

    Hi Michael, thanks for your quick answer !

    Why not use an edit friendly format?
    Because we need to transfer files very fast to remote editing facilities so we think H264 delivers image quality for a relatively low bitrate, that can be then transcoded easily if needed.

    Can you post the media info result for this file?

    *** MediaInfo Mac // Plain text file report
    2010-05-03 22:40:55 +0200
    Information for File: PPT_H264_Widescreen_1920x1080_1.mp4

    General / Container Stream # 1
    Total Video Streams for this File -> 1
    Total Audio Streams for this File -> 1
    Video Codecs Used -> AVC
    Audio Codecs Used -> AAC LC
    File Format -> MPEG-4
    Play Time -> 24s 440ms
    Total File Size -> 36.4 MiB
    Total Stream BitRate -> 12.5 Mbps
    Encoding Library -> Apple QuickTime
    Video Stream # 1
    Codec (Human Name) -> AVC
    Codec (FourCC) -> avc1
    Codec Profile -> Main@L5.0
    Frame Width -> 1 920 pixels
    Frame Height -> 1 080 pixels
    Frame Rate -> 25.000 fps
    Total Frames -> 610
    Display Aspect Ratio -> 16/9
    Video Standard -> Component
    Scan Type -> Progressive
    Colorimetry -> 4:2:0
    Codec Settings (Summary) -> 6 Ref Frames
    QF (like Gordian Knot) -> 0.239
    Codec Settings (CABAC) -> No
    Video Stream Length -> 24s 440ms
    Video Stream BitRate -> 12.4 Mbps
    Video Stream BitRate Mode -> VBR
    Bit Depth -> 24 bits
    Video Stream Size -> 36.0 MiB (99%)
    Date of Original Encoding -> UTC 2010-04-29 15:06:03
    Audio Stream # 1
    Codec -> AAC
    Codec (FourCC) -> 40
    Audio Stream Length -> 24s 366ms
    Audio Stream BitRate -> 128 Kbps
    Audio Stream BitRate Mode -> VBR
    Number of Audio Channels -> 2
    Audio Channel’s Positions -> L R
    Sampling Rate -> 48.0 KHz
    Bit Depth -> 16 bits
    Audio Stream Size -> 381 KiB (1%)
    Date of Original Encoding -> UTC 2010-04-29 15:06:03

    Also, can you post the command line you are using in FFmpeg?

    ffmpeg -y -deinterlace -i FICHIER.mov -vcodec libx264 -vpre normal -vpre main -b 12M -bt 12M -minrate 12M -maxrate 12M -s hd1080 -aspect 16:9 -acodec libfaac -ab 384K -threads 0 -coder 0 -refs 2 -r 25 FICHIER.1080.mp4

    I would like to know why you are not using high profile….

    Since the Episode file that worked better used a main profile, we used the same profile 🙁

    Thanks again.

    Thomas

  • Michael Rampe

    May 4, 2010 at 12:48 am

    The main difference I see between the two files is the Level.

    FFmpeg: Codec Profile -> Main@L4.1
    Episode: Codec Profile -> Main@L5.0

    The level is dictated by the number of macrobloks/bits per sec/image size/frame rate.
    Have a look at the bottom of https://en.wikipedia.org/wiki/H.264 for a good chart explaining the limitations.

    It also directly effects the “decoded picture buffering” which could affect playback in FCP. (Level 4.1 has a buffering limit of 4 frames at 1080, Level 5.0 has a buffering limit of 13 frames at 1080.

    You might want to try adding: “-level 50” to your command line.

    The only other significant difference I see is that you are using -refs 2 whilst episode is using -refs 6.
    Give that a go as well. You do not need “-refs 2” as this is already specified in the “normal” x264 preset but this will override the preset setting for -refs if it is different.

    Also, I see that you are setting minrate and maxrate to 12M. This is a way of creating a constant bitrate file but it still reports as VBR in Mediainfo. Try removing these two flags and see what results you get.

    And finally, try a high profile setting as well. (This sets the -refs to 4)

    ffmpeg -y -deinterlace -i FICHIER.mov -vcodec libx264 –vpre hq -level 50 -b 12M -bt 12M -s hd1080 -aspect 16:9 -acodec libfaac -ab 384K -threads 0 -coder 0 -refs 2 -r 25 FICHIER.1080.mp4

    Just some ideas. Let me know how they go.

    Michael

    “half-way to world domination A.K.A. the belligerent blue bike shed”

  • Thomas Brender

    May 13, 2010 at 4:17 pm

    Hi,

    We finally found a solution to our problem.
    We shorten the GOP size, and it reacted much better.
    We also updated QT and FCP, and even the files we encoded in the first place and used to playback very slow were OK.
    So I guess Apple as other editing software editors are working on a better handling of H264. Hopefully, it will soon becom editable flawless.

    Thank you very much for your help !

    Thomas

  • Michael Rampe

    May 14, 2010 at 6:52 am

    Hi Thomas,

    Good info to know.

    Thanks for posting the end of the story.

    Michael

    “half-way to world domination A.K.A. the belligerent blue bike shed”

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