VideoHelp Forum
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. Hi all,

    Can somebody help me regarding IDR frames in ffmpeg.

    My client wants the below :

    H.264 elementary stream + AAC audio stream muxed in mpeg 2 transport stream.
    H.264 Video bitrate : CBR@1.5mbps
    Frame rate = 29.97 fps.
    Resolution = 720x480 Anamorphic.
    Profile = Main@L3.2 , CABAC.
    GOP length = 15, Every I frame must be an IDR.

    I think this requires the use of keyint=15:keyint_min=15:no-scenecut in ffmpeg to force a closed gop right??

    How do i verify that every I frame is an IDR?

    Also, the client has stated that the H.264 stream must be in streaming format. i.e SPS and other sequence headers must be repeated throughout the stream.

    How do i ensure my H.264 stream is streaming format? do i need to use annex B filter : -bsf:v h264_mp4toannexb?

    My source is Apple ProRes 422 HQ @ 25 fps.

    I would appreciate any help you guys can provide.
    Quote Quote  
  2. Member
    Join Date
    Jul 2014
    Location
    Denmark
    Search Comp PM
    I'm pretty sure that you cannot select between I and IDR frames for the time being, but this might be subject to change:

    http://ffmpeg.org/pipermail/ffmpeg-devel/2015-August/177396.html

    An option "forced_idr" might show up in the future, or it might alredy be implemented, but undocumented. You could test this with x246option "forced_idr=1".

    keyint (or -g) declares the maximum distance between keyframes, keyint_min declares the minimum distance between keyframes. By setting both to 15 you will have a keyframe for each 15 frames no matter what and I do not think this is what you want. AFAIK FFmpeg uses closed GOP by default but you can force it with "-flags +cgop". Repeating SPS (better streamability) can be achieved by forcing local headers with "-flags2 +local_header".

    Hope it helps
    I'm the developer behind FFQueue. My posts might reflect this! ;-)
    Quote Quote  
  3. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Is there a VERY-good reason for not using x264 directly

    IIRC, setting --min-keyint to "1" plus --no-scenecut should give you what your client wants.

    If I were you, I would encode to an elementary stream, and then multiplex with TSmuxer, not with ffmpeg.
    Quote Quote  
  4. Hi TorBru & El Heggunte,

    Thanks for your suggestions.

    TorBru, if i understand correct, i don't need to convert my stream to annex b if I use -flags +local_header? does this ensure SPS & PPS is repeated?

    If I use refs=2, bf=2, b-pyramid=0, b-adapt=0, no-scenecut, keyint=15, keyint_min=1, -flags +cgop I would get a stream with IBBPBBPBBPBBPBPI ?
    Quote Quote  
  5. Originally Posted by Prathamesh View Post
    If I use refs=2, bf=2, b-pyramid=0, b-adapt=0, no-scenecut, keyint=15, keyint_min=1, -flags +cgop I would get a stream with IBBPBBPBBPBBPBPI ?
    Use ffprobe to verify...
    Quote Quote  
  6. You get IPBBPBBPBBPBBPB
    Quote Quote  
  7. Originally Posted by poisondeathray View Post
    You get IPBBPBBPBBPBBPB
    Hi poisondeathray,

    I'm confused, isn't the above a strange GOP structure. Should I use the refs option after setting the B frames to get proper IBBP format?
    Quote Quote  
  8. I'm referring to the storage (coded) order. In display order it would go IBBP...
    Quote Quote  
  9. Originally Posted by poisondeathray View Post
    I'm referring to the storage (coded) order. In display order it would go IBBP...
    Thanks for clarifying that.

    Appreciate all the suggestions guys, Thanks again
    Quote Quote  
  10. Originally Posted by poisondeathray View Post
    You get IPBBPBBPBBPBBPB
    Well... not so sure - depend from content - it can be for example IPPPPPPPBBPBBPP IMHO.
    Quote Quote  
  11. Originally Posted by pandy View Post
    Originally Posted by poisondeathray View Post
    You get IPBBPBBPBBPBBPB
    Well... not so sure - depend from content - it can be for example IPPPPPPPBBPBBPP IMHO.
    not with --b-adapt 0 and --no-scenecut ; it becomes fixed pattern, set GOP size and pattern
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!