[FFmpeg-user] How to make IDR cuts

jim shupert shupert.jim at gmail.com
Sun Apr 21 00:26:20 EEST 2024


On Wed, Apr 3, 2024 at 8:02 AM Mark Filipak <markfilipak.imdb at gmail.com>
wrote:

> Is there more to this? If there is, it's not evident to me.
>
> If there are several B-frames in a row, then adjust your mind to 'see'
> larger shifts across the
> multiple B-frames and adjust PTSs & DTSs to match.
>
>
> Cutting off a leading open GOP:
>                  <————open GOP————>  <—————closed GOP——————>
> PTS order      [_I_][_B_][_P_][_B_][_I_][_B_][_P_][_B_][_P_][_I_]
>                __/  ___¦___/  ___¦___/  ___¦___/  ___¦___/  __/
>               /    /   ¦     /   ¦     /   ¦     /   ¦     /
> DTS order [_I_][_P_][_B_][_I_][_B_][_P_][_B_][_P_][_B_][_I_]
>              X    X    X         X
>
> PTS order                          [_I_][_B_][_P_][_B_][_P_][_I_]
>                                    __/  ___¦___/  ___¦___/  __/
>                                   /    /   ¦     /   ¦     /
> DTS order                     [_I_][_P_][_B_][_P_][_B_][_I_]
>
> Cut on PTS, then fix up the 1st DTS & packet SCRs.
>
> Or, I don't think it's going to hurt anything to leave this:
> PTS order                          [_I_][_B_][_P_][_B_][_P_][_I_]
>                               _______/  ___¦___/  ___¦___/  __/
>                              /         /   ¦     /   ¦     /
> DTS order                [_I_]     [_P_][_B_][_P_][_B_][_I_]
> and just fix-up the packet SCRs.
>
> =====
> Cutting off a leading closed GOP:
>                  <—————closed GOP——————>  <————open GOP————>
> PTS order      [_I_][_B_][_P_][_B_][_P_][_I_][_B_][_P_][_B_][_I_]
>                __/  ___¦___/  ___¦___/  __/  ___¦___/  ___¦___/
>               /    /   ¦     /   ¦     /    /   ¦     /   ¦
> DTS order [_I_][_P_][_B_][_P_][_B_][_I_][_P_][_B_][_I_][_B_]
>              X    X    X    X    X
>
> PTS order                               [_I_][_B_][_P_][_B_][_I_]
>                                         __/  ___¦___/  ___¦___/
>                                        /    /   ¦     /   ¦
> DTS order                          [_I_][_P_][_B_][_I_][_B_]
>
> Just cut it and fix-up the packet SCRs.
>
> =====
> Cutting off a trailing GOP from a closed GOP:
>                  <—————closed GOP——————>
> PTS order      [_I_][_B_][_P_][_B_][_P_][_I_]..
>                __/  ___¦___/  ___¦___/
>               /    /   ¦     /   ¦
> DTS order [_I_][_P_][_B_][_P_][_B_]
>
> Just cut at the end of the closed GOP.
>
> =====
> Cutting off a trailing GOP from an open GOP:
>                  <————open GOP————>
> PTS order      [_I_][_B_][_P_][_B_][_I_]..
>                __/  ___¦___/  ___¦___/
>               /    /   ¦     /   ¦
> DTS order [_I_][_P_][_B_][_I_][_B_]
>
> PTS order      [_I_][_B_][_P_][_B_][_I_]
>                __/  ___¦___/  ___¦___/
>               /    /   ¦     /   ¦
> DTS order [_I_][_P_][_B_][_I_][_B_]
>
> Cut retaining an ending I-frame, only.
>
>
> Honestly, I don't know why the MPEG folks don't supply illustrations
> instead of their torturous text.
>
> This isn't magic, it's Legos.
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>


More information about the ffmpeg-user mailing list