diff mbox series

[FFmpeg-devel,v4,2/2] avformat/mux: Set AV_PKT_FLAG_KEY for is_intra_only packet

Message ID 20200421153524.31550-2-lance.lmwang@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,v4,1/2] avformat/utils: move is_intra_only() to header and rename to ff_is_intra_only() | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Lance Wang April 21, 2020, 3:35 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

The patch will make audio and subtitle packets be marked as AV_PKT_FLAG_KEY.

For audio, it'll caused the audio sample to be sync sample.
To verify ref/fate/movenc results:
1. Get the movenc test data
[lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_old && mv *.mp4 audio_old_

After applied the patch:
[lmwang@vpn ffmpeg]$ make fate-movenc SAMPLES=../fate-suite
[lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_key && mv *.mp4 audio_key

2. Get l-smash and build boxdumper
https://github.com/l-smash/l-smash.git

3. dump the box of crc change mp4 and diff -u
[lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_key/non-empty-moov-no-elst.mp4  > audio_key/non-empty-moov-no-elst.log
[lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_old/non-empty-moov-no-elst.mp4  > audio_old/non-empty-moov-no-elst.log
[lmwang@vpn ffmpeg]$ diff -u audio_key/non-empty-moov-no-elst.log audio_old/non-empty-moov-no-elst.log
-                default_sample_flags = 0x02000000
-                    independent
-                    sync sample
+                default_sample_flags = 0x01010000
+                    dependent
+                    non-sync sample

4. have checked the change of crc are caused by default_sample_flags
non-empty-moov.mp4, non-empty-moov-elst.mp4,
non-empty-moov-no-elst.mp4, empty-moov.mp4, delay-moov-content.mp4,
empty-moov-second-frag.mp4, empty-moov-second-frag-discont.mp4,
delay-moov-second-frag-discont.mp4, delay-moov-elst-second-frag.mp4
etc

5 For subtitle, it'll effect for tests/ref/fate/binsub-movtextenc and
tests/ref/fate/sub2video, that's expecting result for the subtitle is
marked as keyframe. Below is the checking result of binsub-movtextenc:

[lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_key/binsub-movtextenc.mp4
[lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_old/binsub-movtextenc.mp4
[lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_key/binsub-movtextenc.mp4  > audio_key/binsub-movtextenc.log
[lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_old/binsub-movtextenc.mp4  > audio_old/binsub-movtextenc.log
[lmwang@vpn ffmpeg]$ diff -u audio_key/binsub-movtextenc.log audio_old/binsub-movtextenc.log
.... // the key difference is the flag for sync sample
-                flags = 0x000701
+                flags = 0x000301
                     data-offset-present
                     sample-duration-present
                     sample-size-present
-                    sample-flags-present
                 sample_count = 6
-                data_offset = 188
+                data_offset = 164
                 sample[0]
                     sample_duration = 1570000
                     sample_size = 21
-                    sample_flags = 0x02000000
-                        independent
-                        sync sample
-                        degradation_priority = 0
                 sample[1]
                     sample_duration = 510000
                     sample_size = 2
-                    sample_flags = 0x01010000
-                        dependent
-                        non-sync sample
-                        degradation_priority = 0
                 sample[2]
                     sample_duration = 1690000
                     sample_size = 9
-                    sample_flags = 0x02000000
-                        independent
-                        sync sample
-                        degradation_priority = 0

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/internal.h           |  2 +
 libavformat/mux.c                |  7 +++-
 tests/ref/fate/binsub-movtextenc |  2 +-
 tests/ref/fate/movenc            | 50 +++++++++++------------
 tests/ref/fate/sub2video         | 86 ++++++++++++++++++++--------------------
 5 files changed, 77 insertions(+), 70 deletions(-)

Comments

Lance Wang May 5, 2020, 11:34 p.m. UTC | #1
On Tue, Apr 21, 2020 at 11:35:24PM +0800, lance.lmwang@gmail.com wrote:
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> The patch will make audio and subtitle packets be marked as AV_PKT_FLAG_KEY.
> 
> For audio, it'll caused the audio sample to be sync sample.
> To verify ref/fate/movenc results:
> 1. Get the movenc test data
> [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_old && mv *.mp4 audio_old_
> 
> After applied the patch:
> [lmwang@vpn ffmpeg]$ make fate-movenc SAMPLES=../fate-suite
> [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_key && mv *.mp4 audio_key
> 
> 2. Get l-smash and build boxdumper
> https://github.com/l-smash/l-smash.git
> 
> 3. dump the box of crc change mp4 and diff -u
> [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_key/non-empty-moov-no-elst.mp4  > audio_key/non-empty-moov-no-elst.log
> [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_old/non-empty-moov-no-elst.mp4  > audio_old/non-empty-moov-no-elst.log
> [lmwang@vpn ffmpeg]$ diff -u audio_key/non-empty-moov-no-elst.log audio_old/non-empty-moov-no-elst.log
> -                default_sample_flags = 0x02000000
> -                    independent
> -                    sync sample
> +                default_sample_flags = 0x01010000
> +                    dependent
> +                    non-sync sample
> 
> 4. have checked the change of crc are caused by default_sample_flags
> non-empty-moov.mp4, non-empty-moov-elst.mp4,
> non-empty-moov-no-elst.mp4, empty-moov.mp4, delay-moov-content.mp4,
> empty-moov-second-frag.mp4, empty-moov-second-frag-discont.mp4,
> delay-moov-second-frag-discont.mp4, delay-moov-elst-second-frag.mp4
> etc
> 
> 5 For subtitle, it'll effect for tests/ref/fate/binsub-movtextenc and
> tests/ref/fate/sub2video, that's expecting result for the subtitle is
> marked as keyframe. Below is the checking result of binsub-movtextenc:
> 
> [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_key/binsub-movtextenc.mp4
> [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_old/binsub-movtextenc.mp4
> [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_key/binsub-movtextenc.mp4  > audio_key/binsub-movtextenc.log
> [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_old/binsub-movtextenc.mp4  > audio_old/binsub-movtextenc.log
> [lmwang@vpn ffmpeg]$ diff -u audio_key/binsub-movtextenc.log audio_old/binsub-movtextenc.log
> .... // the key difference is the flag for sync sample
> -                flags = 0x000701
> +                flags = 0x000301
>                      data-offset-present
>                      sample-duration-present
>                      sample-size-present
> -                    sample-flags-present
>                  sample_count = 6
> -                data_offset = 188
> +                data_offset = 164
>                  sample[0]
>                      sample_duration = 1570000
>                      sample_size = 21
> -                    sample_flags = 0x02000000
> -                        independent
> -                        sync sample
> -                        degradation_priority = 0
>                  sample[1]
>                      sample_duration = 510000
>                      sample_size = 2
> -                    sample_flags = 0x01010000
> -                        dependent
> -                        non-sync sample
> -                        degradation_priority = 0
>                  sample[2]
>                      sample_duration = 1690000
>                      sample_size = 9
> -                    sample_flags = 0x02000000
> -                        independent
> -                        sync sample
> -                        degradation_priority = 0
> 


will apply the patchset if no further comments tomorrow.


> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavformat/internal.h           |  2 +
>  libavformat/mux.c                |  7 +++-
>  tests/ref/fate/binsub-movtextenc |  2 +-
>  tests/ref/fate/movenc            | 50 +++++++++++------------
>  tests/ref/fate/sub2video         | 86 ++++++++++++++++++++--------------------
>  5 files changed, 77 insertions(+), 70 deletions(-)
> 
> diff --git a/libavformat/internal.h b/libavformat/internal.h
> index 716e42c..c4fac5c 100644
> --- a/libavformat/internal.h
> +++ b/libavformat/internal.h
> @@ -189,6 +189,8 @@ struct AVStreamInternal {
>       */
>      int need_context_update;
>  
> +    int is_intra_only;
> +
>      FFFrac *priv_pts;
>  };
>  
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index a6253f5..ea6524f 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -357,6 +357,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>          if (desc && desc->props & AV_CODEC_PROP_REORDER)
>              st->internal->reorder = 1;
>  
> +        st->internal->is_intra_only = ff_is_intra_only(par->codec_id);
> +
>          if (of->codec_tag) {
>              if (   par->codec_tag
>                  && par->codec_id == AV_CODEC_ID_RAWVIDEO
> @@ -773,6 +775,7 @@ static int check_packet(AVFormatContext *s, AVPacket *pkt)
>  static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>  {
>      int ret;
> +    AVStream *st = s->streams[pkt->stream_index];
>  
>      ret = check_packet(s, pkt);
>      if (ret < 0)
> @@ -781,7 +784,6 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>  #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
>      /* sanitize the timestamps */
>      if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
> -        AVStream *st = s->streams[pkt->stream_index];
>  
>          /* when there is no reordering (so dts is equal to pts), but
>           * only one of them is set, set the other as well */
> @@ -818,6 +820,9 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>          }
>      }
>  #endif
> +    /* update flags */
> +    if (st->internal->is_intra_only)
> +        pkt->flags |= AV_PKT_FLAG_KEY;
>  
>      return 0;
>  }
> diff --git a/tests/ref/fate/binsub-movtextenc b/tests/ref/fate/binsub-movtextenc
> index 78c05f4..a8f94b7 100644
> --- a/tests/ref/fate/binsub-movtextenc
> +++ b/tests/ref/fate/binsub-movtextenc
> @@ -1 +1 @@
> -35adf776cd73e808186ae7124445f4b8
> +fc6d07679ac1f718aa50de687924cd97
> diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
> index 637a347..fb39b98 100644
> --- a/tests/ref/fate/movenc
> +++ b/tests/ref/fate/movenc
> @@ -2,17 +2,17 @@ write_data len 36, time nopts, type header atom ftyp
>  write_data len 2389, time nopts, type header atom -
>  write_data len 788, time 1000000, type sync atom moof
>  write_data len 110, time nopts, type trailer atom -
> -66cf48604f039aa9a51711786f5c8778 3323 non-empty-moov
> +5f401347fc3c771b819e2449d69d4861 3323 non-empty-moov
>  write_data len 36, time nopts, type header atom ftyp
>  write_data len 2721, time nopts, type header atom -
>  write_data len 908, time 966667, type sync atom moof
>  write_data len 110, time nopts, type trailer atom -
> -04b2e86f455af94f9258b8d66dbf71f5 3775 non-empty-moov-elst
> +4267feee527adf8cd4f7b36ac0fc0872 3775 non-empty-moov-elst
>  write_data len 36, time nopts, type header atom ftyp
>  write_data len 2629, time nopts, type header atom -
>  write_data len 908, time 1000000, type sync atom moof
>  write_data len 110, time nopts, type trailer atom -
> -e9f6fa032d6d8265d67aef5de81a48bf 3683 non-empty-moov-no-elst
> +44077b9ad45f3e16fafe4e5ada54e9b0 3683 non-empty-moov-no-elst
>  write_data len 24, time nopts, type header atom ftyp
>  write_data len 1171, time nopts, type header atom -
>  write_data len 728, time 0, type sync atom moof
> @@ -20,35 +20,35 @@ write_data len 828, time nopts, type unknown atom -
>  write_data len 728, time 999999, type sync atom moof
>  write_data len 812, time nopts, type unknown atom -
>  write_data len 148, time nopts, type trailer atom -
> -da105e0b2c19079519c6eed7d5a1151c 4439 ismv
> +92ce825ff40505ec8676191705adb7e7 4439 ismv
>  write_data len 36, time nopts, type header atom ftyp
>  write_data len 1123, time nopts, type header atom -
>  write_data len 796, time 0, type sync atom moof
>  write_data len 788, time 1000000, type sync atom moof
>  write_data len 148, time nopts, type trailer atom -
> -e6a4b15443d006efd727a80f6624b7db 2891 empty-moov
> +08f4b3ad3a3ea224b2ee731476b9056b 2891 empty-moov
>  write_data len 36, time nopts, type header atom ftyp
>  write_data len 1123, time nopts, type header atom -
>  write_data len 1068, time 0, type sync atom moof
>  write_data len 908, time 1000000, type sync atom moof
>  write_data len 148, time nopts, type trailer atom -
> -800f854aff2ac76dfaddebd0562c75b9 3283 empty-moov-no-elst
> +d7a2dcb43eb0f95f92669f55fc7adeba 3283 empty-moov-no-elst
>  write_data len 36, time nopts, type header atom ftyp
>  write_data len 1123, time nopts, type header atom -
>  write_data len 900, time -33333, type sync atom moof
>  write_data len 908, time 966667, type sync atom moof
>  write_data len 148, time nopts, type trailer atom -
> -eca1a945c9063dab0858af6b85925533 3115 empty-moov-no-elst-no-adjust
> +ea70ca697306976879be408431c27aee 3115 empty-moov-no-elst-no-adjust
>  write_data len 1159, time nopts, type header atom ftyp
>  write_data len 796, time 0, type sync atom moof
>  write_data len 788, time 1000000, type sync atom moof
>  write_data len 148, time nopts, type trailer atom -
> -e6a4b15443d006efd727a80f6624b7db 2891 delay-moov
> +08f4b3ad3a3ea224b2ee731476b9056b 2891 delay-moov
>  write_data len 1231, time nopts, type header atom ftyp
>  write_data len 916, time -33333, type sync atom moof
>  write_data len 908, time 966667, type sync atom moof
>  write_data len 148, time nopts, type trailer atom -
> -c2ecdbc80668fcee73f5a039e2dba579 3203 delay-moov-elst
> +314cc3b6296f4ee583b328a34be50b2f 3203 delay-moov-elst
>  write_data len 1195, time nopts, type header atom ftyp
>  write_data len 836, time 0, type sync atom moof
>  write_data len 67, time nopts, type trailer atom -
> @@ -63,66 +63,66 @@ write_data len 1123, time nopts, type header atom -
>  351ae2c8b6d35d98b4848c309cce6704 1159 empty-moov-header
>  write_data len 796, time 0, type sync atom moof
>  write_data len 788, time 1000000, type sync atom moof
> -a0165f4a26a409212b0946e981bdefb9 1584 empty-moov-content
> +289ee982188d66988a374a462b0b5376 1584 empty-moov-content
>  write_data len 148, time nopts, type trailer atom -
>  write_data len 1159, time nopts, type header atom ftyp
>  351ae2c8b6d35d98b4848c309cce6704 1159 delay-moov-header
>  write_data len 796, time 0, type sync atom moof
>  write_data len 788, time 1000000, type sync atom moof
> -a0165f4a26a409212b0946e981bdefb9 1584 delay-moov-content
> +289ee982188d66988a374a462b0b5376 1584 delay-moov-content
>  write_data len 148, time nopts, type trailer atom -
>  write_data len 28, time nopts, type header atom -
>  write_data len 1123, time nopts, type header atom -
>  write_data len 884, time 0, type sync atom sidx
>  write_data len 876, time 1000000, type sync atom sidx
> -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag
> +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag
>  write_data len 148, time nopts, type trailer atom -
>  write_data len 28, time nopts, type header atom -
>  write_data len 1123, time nopts, type header atom -
>  write_data len 876, time 1000000, type sync atom sidx
> -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag-discont
> +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag-discont
>  write_data len 110, time nopts, type trailer atom -
>  write_data len 1223, time nopts, type header atom -
>  write_data len 876, time 1000000, type sync atom sidx
> -272a474cfd2a68cc5f05b426b14a2b7d 876 delay-moov-second-frag-discont
> +c0307f99a2a362205b7e3d65b1066f86 876 delay-moov-second-frag-discont
>  write_data len 110, time nopts, type trailer atom -
>  write_data len 1223, time nopts, type header atom ftyp
>  b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init
>  write_data len 988, time -33333, type sync atom sidx
>  write_data len 996, time 966667, type sync atom sidx
> -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag
> +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag
>  write_data len 148, time nopts, type trailer atom -
>  write_data len 1223, time nopts, type header atom ftyp
>  b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init-discont
>  write_data len 996, time 966667, type sync atom sidx
> -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag-discont
> +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag-discont
>  write_data len 110, time nopts, type trailer atom -
>  write_data len 1223, time nopts, type header atom ftyp
>  041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init
>  write_data len 1004, time -33333, type sync atom sidx
>  write_data len 996, time 966667, type sync atom sidx
> -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag
> +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag
>  write_data len 148, time nopts, type trailer atom -
>  write_data len 1223, time nopts, type header atom ftyp
>  041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init-discont
>  write_data len 996, time 966667, type sync atom sidx
> -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag-discont
> +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag-discont
>  write_data len 110, time nopts, type trailer atom -
>  write_data len 1247, time nopts, type header atom ftyp
>  80511a51d1ac9cde62337eed7176ae03 1247 delay-moov-elst-signal-init-discont-largets
>  write_data len 996, time 279621233333, type sync atom sidx
> -41cac4c3df656a87bb38363fdcd745e6 996 delay-moov-elst-signal-second-frag-discont-largets
> +dc695d65e8a0cdafee28acd8a5ccf81a 996 delay-moov-elst-signal-second-frag-discont-largets
>  write_data len 110, time nopts, type trailer atom -
>  write_data len 1223, time nopts, type header atom ftyp
>  write_data len 2572, time -333333, type sync atom sidx
>  write_data len 996, time 5166667, type sync atom sidx
>  write_data len 148, time nopts, type trailer atom -
> -c3eb39921c90724784d1ab84fac58b34 4939 vfr
> +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr
>  write_data len 1223, time nopts, type header atom ftyp
>  write_data len 2572, time -333333, type sync atom sidx
>  write_data len 996, time 5166667, type sync atom sidx
>  write_data len 148, time nopts, type trailer atom -
> -c3eb39921c90724784d1ab84fac58b34 4939 vfr-noduration
> +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr-noduration
>  write_data len 1231, time nopts, type header atom ftyp
>  write_data len 1500, time -333333, type sync atom moof
>  write_data len 1500, time nopts, type unknown atom -
> @@ -131,7 +131,7 @@ write_data len 1500, time 9666667, type sync atom moof
>  write_data len 1500, time nopts, type unknown atom -
>  write_data len 1004, time nopts, type unknown atom -
>  write_data len 148, time nopts, type trailer atom -
> -5bde1358e246e715b2096daa321c9f1b 9299 large_frag
> +08b6401dc81912e5264245b7233c4ab3 9299 large_frag
>  write_data len 1231, time nopts, type header atom ftyp
>  write_data len 684, time -33333, type sync atom moof
>  write_data len 504, time 800000, type boundary atom moof
> @@ -139,15 +139,15 @@ write_data len 420, time 1266667, type boundary atom moof
>  write_data len 668, time 1566667, type sync atom moof
>  write_data len 440, time 2233333, type boundary atom moof
>  write_data len 262, time nopts, type trailer atom -
> -47cc2460c4b18390c67991cf3251409b 4209 vfr-noduration-interleave
> +a5d087611a9229ba91eb0964cf2f17d9 4209 vfr-noduration-interleave
>  write_data len 1231, time nopts, type header atom ftyp
>  write_data len 916, time 0, type sync atom moof
>  write_data len 908, time 1000000, type sync atom moof
>  write_data len 148, time nopts, type trailer atom -
> -c200a345c365dd35a31e7e62a9ae6c10 3203 delay-moov-elst-neg-cts
> +d81c3a0ce5940a2db74c99ad435e0560 3203 delay-moov-elst-neg-cts
>  write_data len 36, time nopts, type header atom ftyp
>  write_data len 1123, time nopts, type header atom -
>  write_data len 900, time 0, type sync atom moof
>  write_data len 908, time 1000000, type sync atom moof
>  write_data len 148, time nopts, type trailer atom -
> -868bb53d861d81b1c15ef4d59afc83b5 3115 empty-moov-neg-cts
> +3be575022e446855bca1e45b7942cc0c 3115 empty-moov-neg-cts
> diff --git a/tests/ref/fate/sub2video b/tests/ref/fate/sub2video
> index 4e034a5..80abe9c 100644
> --- a/tests/ref/fate/sub2video
> +++ b/tests/ref/fate/sub2video
> @@ -10,7 +10,7 @@
>  0,          0,          0,        1,   518400, 0x83c27b82
>  0,          1,          1,        1,   518400, 0x4051c7f9
>  0,          2,          2,        1,   518400, 0xfb00e17e
> -1,     499000,     499000,  4960000,     1015, 0x19e092d2, F=0x0
> +1,     499000,     499000,  4960000,     1015, 0x19e092d2
>  0,          3,          3,        1,   518400, 0x192abb74
>  0,          4,          4,        1,   518400, 0x4669a88b
>  0,          5,          5,        1,   518400, 0xaababe00
> @@ -58,129 +58,129 @@
>  0,         47,         47,        1,   518400, 0xde69683f
>  0,         48,         48,        1,   518400, 0x7df08fba
>  0,         49,         49,        1,   518400, 0xbab197ea
> -1,   15355000,   15355000,  4733000,     2094, 0x3c171425, F=0x0
> +1,   15355000,   15355000,  4733000,     2094, 0x3c171425
>  0,         77,         77,        1,   518400, 0x902285d9
>  0,        100,        100,        1,   518400, 0xbab197ea
> -1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21, F=0x0
> +1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21
>  0,        244,        244,        1,   518400, 0x7a11c812
>  0,        257,        257,        1,   518400, 0xbab197ea
> -1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05, F=0x0
> +1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05
>  0,        258,        258,        1,   518400, 0x34cdddee
>  0,        269,        269,        1,   518400, 0xbab197ea
> -1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed, F=0x0
> +1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed
>  0,        270,        270,        1,   518400, 0x4db4ce51
>  0,        283,        283,        1,   518400, 0xbab197ea
> -1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7, F=0x0
> +1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7
>  0,        284,        284,        1,   518400, 0xe6bc0ea9
>  0,        290,        290,        1,   518400, 0xbab197ea
> -1,   58014000,   58014000,  1661000,      969, 0xe01878f0, F=0x0
> +1,   58014000,   58014000,  1661000,      969, 0xe01878f0
>  0,        291,        291,        1,   518400, 0xa8643af7
>  0,        298,        298,        1,   518400, 0xbab197ea
> -1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1, F=0x0
> +1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1
>  0,        339,        339,        1,   518400, 0xb1885c67
>  0,        345,        345,        1,   518400, 0xbab197ea
> -1,   69175000,   69175000,  1558000,      802, 0xf48531ba, F=0x0
> +1,   69175000,   69175000,  1558000,      802, 0xf48531ba
>  0,        346,        346,        1,   518400, 0x378e3fd0
>  0,        354,        354,        1,   518400, 0xbab197ea
> -1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd, F=0x0
> +1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd
>  0,        355,        355,        1,   518400, 0xa3782469
>  0,        363,        363,        1,   518400, 0xbab197ea
> -1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82, F=0x0
> +1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82
>  0,        364,        364,        1,   518400, 0xba23a0d5
>  0,        374,        374,        1,   518400, 0xbab197ea
> -1,   74806000,   74806000,  1831000,     2116, 0x96514097, F=0x0
> +1,   74806000,   74806000,  1831000,     2116, 0x96514097
>  0,        375,        375,        1,   518400, 0x129de2f8
>  0,        383,        383,        1,   518400, 0xbab197ea
> -1,   76716000,   76716000,  1262000,     1822, 0xefccc72e, F=0x0
> +1,   76716000,   76716000,  1262000,     1822, 0xefccc72e
>  0,        384,        384,        1,   518400, 0x19772f0f
>  0,        390,        390,        1,   518400, 0xbab197ea
> -1,   78051000,   78051000,  1524000,      987, 0x7b927a27, F=0x0
> +1,   78051000,   78051000,  1524000,      987, 0x7b927a27
>  0,        391,        391,        1,   518400, 0x56f54e73
>  0,        398,        398,        1,   518400, 0xbab197ea
> -1,   79644000,   79644000,  2662000,     2956, 0x190778f7, F=0x0
> +1,   79644000,   79644000,  2662000,     2956, 0x190778f7
>  0,        399,        399,        1,   518400, 0x300b5247
> -1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3, F=0x0
> +1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3
>  0,        412,        412,        1,   518400, 0xbab197ea
>  0,        413,        413,        1,   518400, 0x6fd028fa
>  0,        426,        426,        1,   518400, 0xbab197ea
> -1,   85225000,   85225000,  2366000,     2585, 0x74d0048f, F=0x0
> +1,   85225000,   85225000,  2366000,     2585, 0x74d0048f
>  0,        427,        427,        1,   518400, 0x01f80e9d
>  0,        438,        438,        1,   518400, 0xbab197ea
> -1,   87652000,   87652000,  1831000,      634, 0x8832fda1, F=0x0
> +1,   87652000,   87652000,  1831000,      634, 0x8832fda1
>  0,        439,        439,        1,   518400, 0xb48d90c0
>  0,        447,        447,        1,   518400, 0xbab197ea
> -1,   91531000,   91531000,  2332000,     2080, 0x97a1146f, F=0x0
> +1,   91531000,   91531000,  2332000,     2080, 0x97a1146f
>  0,        458,        458,        1,   518400, 0xcb5a0173
>  0,        469,        469,        1,   518400, 0xbab197ea
> -1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684, F=0x0
> +1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684
>  0,        478,        478,        1,   518400, 0xb8a323e4
>  0,        494,        494,        1,   518400, 0xbab197ea
> -1,   98872000,   98872000,  2161000,     1875, 0x9002ef71, F=0x0
> +1,   98872000,   98872000,  2161000,     1875, 0x9002ef71
>  0,        495,        495,        1,   518400, 0xc43518ba
>  0,        505,        505,        1,   518400, 0xbab197ea
> -1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c, F=0x0
> +1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c
>  0,        506,        506,        1,   518400, 0x04e38692
>  0,        526,        526,        1,   518400, 0xbab197ea
> -1,  105303000,  105303000,  2730000,     3094, 0xf203a663, F=0x0
> +1,  105303000,  105303000,  2730000,     3094, 0xf203a663
>  0,        527,        527,        1,   518400, 0x856b0ee5
>  0,        540,        540,        1,   518400, 0xbab197ea
> -1,  108106000,  108106000,  2059000,     2404, 0x41a7b429, F=0x0
> +1,  108106000,  108106000,  2059000,     2404, 0x41a7b429
>  0,        541,        541,        1,   518400, 0x3e5beee2
>  0,        551,        551,        1,   518400, 0xbab197ea
> -1,  141556000,  141556000,  1661000,     1088, 0xde20aa20, F=0x0
> +1,  141556000,  141556000,  1661000,     1088, 0xde20aa20
>  0,        708,        708,        1,   518400, 0xb8bc1365
>  0,        716,        716,        1,   518400, 0xbab197ea
>  0,        817,        817,        1,   518400, 0x83efa32d
> -1,  163445000,  163445000,  1331000,      339, 0x8bd186ef, F=0x0
> +1,  163445000,  163445000,  1331000,      339, 0x8bd186ef
>  0,        824,        824,        1,   518400, 0xbab197ea
>  0,        840,        840,        1,   518400, 0x03ea0e90
> -1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d, F=0x0
> +1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d
>  0,        850,        850,        1,   518400, 0xbab197ea
> -1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe, F=0x0
> +1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe
>  0,        851,        851,        1,   518400, 0x8780239e
>  0,        858,        858,        1,   518400, 0xbab197ea
>  0,        861,        861,        1,   518400, 0x6eb72347
> -1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769, F=0x0
> +1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769
>  0,        869,        869,        1,   518400, 0xbab197ea
> -1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc, F=0x0
> +1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc
>  0,        870,        870,        1,   518400, 0x9c4a3a3d
>  0,        879,        879,        1,   518400, 0xbab197ea
> -1,  175957000,  175957000,  1763000,     1019, 0x20409355, F=0x0
> +1,  175957000,  175957000,  1763000,     1019, 0x20409355
>  0,        880,        880,        1,   518400, 0xc9ebfa89
>  0,        889,        889,        1,   518400, 0xbab197ea
>  0,        946,        946,        1,   518400, 0xbaf801ef
> -1,  189295000,  189295000,  1968000,     1596, 0x408c726e, F=0x0
> +1,  189295000,  189295000,  1968000,     1596, 0x408c726e
>  0,        956,        956,        1,   518400, 0xbab197ea
> -1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b, F=0x0
> +1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b
>  0,        957,        957,        1,   518400, 0x59f4e72f
>  0,        963,        963,        1,   518400, 0xbab197ea
> -1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4, F=0x0
> +1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4
>  0,        964,        964,        1,   518400, 0x9d5b9d69
>  0,        972,        972,        1,   518400, 0xbab197ea
> -1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8, F=0x0
> +1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8
>  0,        976,        976,        1,   518400, 0x923d1ce7
>  0,        981,        981,        1,   518400, 0xbab197ea
> -1,  196361000,  196361000,  1524000,     1715, 0x695ca41e, F=0x0
> +1,  196361000,  196361000,  1524000,     1715, 0x695ca41e
>  0,        982,        982,        1,   518400, 0x6e652cd2
>  0,        989,        989,        1,   518400, 0xbab197ea
> -1,  197946000,  197946000,  1160000,      789, 0xc63a189e, F=0x0
> +1,  197946000,  197946000,  1160000,      789, 0xc63a189e
>  0,        990,        990,        1,   518400, 0x25113966
>  0,        996,        996,        1,   518400, 0xbab197ea
> -1,  199230000,  199230000,  1627000,     1846, 0xeea8c599, F=0x0
> +1,  199230000,  199230000,  1627000,     1846, 0xeea8c599
>  0,        997,        997,        1,   518400, 0x2dc83609
>  0,       1004,       1004,        1,   518400, 0xbab197ea
> -1,  200924000,  200924000,  1763000,      922, 0xd4a87222, F=0x0
> +1,  200924000,  200924000,  1763000,      922, 0xd4a87222
>  0,       1005,       1005,        1,   518400, 0x90483bc6
>  0,       1013,       1013,        1,   518400, 0xbab197ea
>  0,       1053,       1053,        1,   518400, 0x3de86ab7
> -1,  210600000,  210600000,  1831000,      665, 0x55580135, F=0x0
> +1,  210600000,  210600000,  1831000,      665, 0x55580135
>  0,       1062,       1062,        1,   518400, 0xbab197ea
> -1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5, F=0x0
> +1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5
>  0,       1074,       1074,        1,   518400, 0x8c320e68
>  0,       1082,       1082,        1,   518400, 0xbab197ea
>  0,       1128,       1128,        1,   518400, 0x81e977b2
> -1,  225640000,  225640000,  2127000,     2133, 0x670c11a5, F=0x0
> +1,  225640000,  225640000,  2127000,     2133, 0x670c11a5
>  0,       1139,       1139,        1,   518400, 0xbab197ea
> -1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57, F=0x0
> +1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57
>  0,       1140,       1140,        1,   518400, 0xb046dd30
>  0,       1145,       1145,        1,   518400, 0xbab197ea
> -- 
> 2.9.5
>
Marton Balint May 6, 2020, 8:11 a.m. UTC | #2
On Tue, 21 Apr 2020, lance.lmwang@gmail.com wrote:

> From: Limin Wang <lance.lmwang@gmail.com>
>
> The patch will make audio and subtitle packets be marked as AV_PKT_FLAG_KEY.

Why the subtitles? Is it possible that the patch description is outdated? 
I don't see from the code how would this apply to subtitles, after all 
is_intra_only only check for audio and video, no?

Thanks,
Marton

>
> For audio, it'll caused the audio sample to be sync sample.
> To verify ref/fate/movenc results:
> 1. Get the movenc test data
> [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_old && mv *.mp4 audio_old_
>
> After applied the patch:
> [lmwang@vpn ffmpeg]$ make fate-movenc SAMPLES=../fate-suite
> [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_key && mv *.mp4 audio_key
>
> 2. Get l-smash and build boxdumper
> https://github.com/l-smash/l-smash.git
>
> 3. dump the box of crc change mp4 and diff -u
> [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_key/non-empty-moov-no-elst.mp4  > audio_key/non-empty-moov-no-elst.log
> [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_old/non-empty-moov-no-elst.mp4  > audio_old/non-empty-moov-no-elst.log
> [lmwang@vpn ffmpeg]$ diff -u audio_key/non-empty-moov-no-elst.log audio_old/non-empty-moov-no-elst.log
> -                default_sample_flags = 0x02000000
> -                    independent
> -                    sync sample
> +                default_sample_flags = 0x01010000
> +                    dependent
> +                    non-sync sample
>
> 4. have checked the change of crc are caused by default_sample_flags
> non-empty-moov.mp4, non-empty-moov-elst.mp4,
> non-empty-moov-no-elst.mp4, empty-moov.mp4, delay-moov-content.mp4,
> empty-moov-second-frag.mp4, empty-moov-second-frag-discont.mp4,
> delay-moov-second-frag-discont.mp4, delay-moov-elst-second-frag.mp4
> etc
>
> 5 For subtitle, it'll effect for tests/ref/fate/binsub-movtextenc and
> tests/ref/fate/sub2video, that's expecting result for the subtitle is
> marked as keyframe. Below is the checking result of binsub-movtextenc:
>
> [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_key/binsub-movtextenc.mp4
> [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_old/binsub-movtextenc.mp4
> [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_key/binsub-movtextenc.mp4  > audio_key/binsub-movtextenc.log
> [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_old/binsub-movtextenc.mp4  > audio_old/binsub-movtextenc.log
> [lmwang@vpn ffmpeg]$ diff -u audio_key/binsub-movtextenc.log audio_old/binsub-movtextenc.log
> .... // the key difference is the flag for sync sample
> -                flags = 0x000701
> +                flags = 0x000301
>                     data-offset-present
>                     sample-duration-present
>                     sample-size-present
> -                    sample-flags-present
>                 sample_count = 6
> -                data_offset = 188
> +                data_offset = 164
>                 sample[0]
>                     sample_duration = 1570000
>                     sample_size = 21
> -                    sample_flags = 0x02000000
> -                        independent
> -                        sync sample
> -                        degradation_priority = 0
>                 sample[1]
>                     sample_duration = 510000
>                     sample_size = 2
> -                    sample_flags = 0x01010000
> -                        dependent
> -                        non-sync sample
> -                        degradation_priority = 0
>                 sample[2]
>                     sample_duration = 1690000
>                     sample_size = 9
> -                    sample_flags = 0x02000000
> -                        independent
> -                        sync sample
> -                        degradation_priority = 0
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
> libavformat/internal.h           |  2 +
> libavformat/mux.c                |  7 +++-
> tests/ref/fate/binsub-movtextenc |  2 +-
> tests/ref/fate/movenc            | 50 +++++++++++------------
> tests/ref/fate/sub2video         | 86 ++++++++++++++++++++--------------------
> 5 files changed, 77 insertions(+), 70 deletions(-)
>
> diff --git a/libavformat/internal.h b/libavformat/internal.h
> index 716e42c..c4fac5c 100644
> --- a/libavformat/internal.h
> +++ b/libavformat/internal.h
> @@ -189,6 +189,8 @@ struct AVStreamInternal {
>      */
>     int need_context_update;
> 
> +    int is_intra_only;
> +
>     FFFrac *priv_pts;
> };
> 
> diff --git a/libavformat/mux.c b/libavformat/mux.c
> index a6253f5..ea6524f 100644
> --- a/libavformat/mux.c
> +++ b/libavformat/mux.c
> @@ -357,6 +357,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>         if (desc && desc->props & AV_CODEC_PROP_REORDER)
>             st->internal->reorder = 1;
> 
> +        st->internal->is_intra_only = ff_is_intra_only(par->codec_id);
> +
>         if (of->codec_tag) {
>             if (   par->codec_tag
>                 && par->codec_id == AV_CODEC_ID_RAWVIDEO
> @@ -773,6 +775,7 @@ static int check_packet(AVFormatContext *s, AVPacket *pkt)
> static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
> {
>     int ret;
> +    AVStream *st = s->streams[pkt->stream_index];
>
>     ret = check_packet(s, pkt);
>     if (ret < 0)
> @@ -781,7 +784,6 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
> #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
>     /* sanitize the timestamps */
>     if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
> -        AVStream *st = s->streams[pkt->stream_index];
>
>         /* when there is no reordering (so dts is equal to pts), but
>          * only one of them is set, set the other as well */
> @@ -818,6 +820,9 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>         }
>     }
> #endif
> +    /* update flags */
> +    if (st->internal->is_intra_only)
> +        pkt->flags |= AV_PKT_FLAG_KEY;
>
>     return 0;
> }
> diff --git a/tests/ref/fate/binsub-movtextenc b/tests/ref/fate/binsub-movtextenc
> index 78c05f4..a8f94b7 100644
> --- a/tests/ref/fate/binsub-movtextenc
> +++ b/tests/ref/fate/binsub-movtextenc
> @@ -1 +1 @@
> -35adf776cd73e808186ae7124445f4b8
> +fc6d07679ac1f718aa50de687924cd97
> diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
> index 637a347..fb39b98 100644
> --- a/tests/ref/fate/movenc
> +++ b/tests/ref/fate/movenc
> @@ -2,17 +2,17 @@ write_data len 36, time nopts, type header atom ftyp
> write_data len 2389, time nopts, type header atom -
> write_data len 788, time 1000000, type sync atom moof
> write_data len 110, time nopts, type trailer atom -
> -66cf48604f039aa9a51711786f5c8778 3323 non-empty-moov
> +5f401347fc3c771b819e2449d69d4861 3323 non-empty-moov
> write_data len 36, time nopts, type header atom ftyp
> write_data len 2721, time nopts, type header atom -
> write_data len 908, time 966667, type sync atom moof
> write_data len 110, time nopts, type trailer atom -
> -04b2e86f455af94f9258b8d66dbf71f5 3775 non-empty-moov-elst
> +4267feee527adf8cd4f7b36ac0fc0872 3775 non-empty-moov-elst
> write_data len 36, time nopts, type header atom ftyp
> write_data len 2629, time nopts, type header atom -
> write_data len 908, time 1000000, type sync atom moof
> write_data len 110, time nopts, type trailer atom -
> -e9f6fa032d6d8265d67aef5de81a48bf 3683 non-empty-moov-no-elst
> +44077b9ad45f3e16fafe4e5ada54e9b0 3683 non-empty-moov-no-elst
> write_data len 24, time nopts, type header atom ftyp
> write_data len 1171, time nopts, type header atom -
> write_data len 728, time 0, type sync atom moof
> @@ -20,35 +20,35 @@ write_data len 828, time nopts, type unknown atom -
> write_data len 728, time 999999, type sync atom moof
> write_data len 812, time nopts, type unknown atom -
> write_data len 148, time nopts, type trailer atom -
> -da105e0b2c19079519c6eed7d5a1151c 4439 ismv
> +92ce825ff40505ec8676191705adb7e7 4439 ismv
> write_data len 36, time nopts, type header atom ftyp
> write_data len 1123, time nopts, type header atom -
> write_data len 796, time 0, type sync atom moof
> write_data len 788, time 1000000, type sync atom moof
> write_data len 148, time nopts, type trailer atom -
> -e6a4b15443d006efd727a80f6624b7db 2891 empty-moov
> +08f4b3ad3a3ea224b2ee731476b9056b 2891 empty-moov
> write_data len 36, time nopts, type header atom ftyp
> write_data len 1123, time nopts, type header atom -
> write_data len 1068, time 0, type sync atom moof
> write_data len 908, time 1000000, type sync atom moof
> write_data len 148, time nopts, type trailer atom -
> -800f854aff2ac76dfaddebd0562c75b9 3283 empty-moov-no-elst
> +d7a2dcb43eb0f95f92669f55fc7adeba 3283 empty-moov-no-elst
> write_data len 36, time nopts, type header atom ftyp
> write_data len 1123, time nopts, type header atom -
> write_data len 900, time -33333, type sync atom moof
> write_data len 908, time 966667, type sync atom moof
> write_data len 148, time nopts, type trailer atom -
> -eca1a945c9063dab0858af6b85925533 3115 empty-moov-no-elst-no-adjust
> +ea70ca697306976879be408431c27aee 3115 empty-moov-no-elst-no-adjust
> write_data len 1159, time nopts, type header atom ftyp
> write_data len 796, time 0, type sync atom moof
> write_data len 788, time 1000000, type sync atom moof
> write_data len 148, time nopts, type trailer atom -
> -e6a4b15443d006efd727a80f6624b7db 2891 delay-moov
> +08f4b3ad3a3ea224b2ee731476b9056b 2891 delay-moov
> write_data len 1231, time nopts, type header atom ftyp
> write_data len 916, time -33333, type sync atom moof
> write_data len 908, time 966667, type sync atom moof
> write_data len 148, time nopts, type trailer atom -
> -c2ecdbc80668fcee73f5a039e2dba579 3203 delay-moov-elst
> +314cc3b6296f4ee583b328a34be50b2f 3203 delay-moov-elst
> write_data len 1195, time nopts, type header atom ftyp
> write_data len 836, time 0, type sync atom moof
> write_data len 67, time nopts, type trailer atom -
> @@ -63,66 +63,66 @@ write_data len 1123, time nopts, type header atom -
> 351ae2c8b6d35d98b4848c309cce6704 1159 empty-moov-header
> write_data len 796, time 0, type sync atom moof
> write_data len 788, time 1000000, type sync atom moof
> -a0165f4a26a409212b0946e981bdefb9 1584 empty-moov-content
> +289ee982188d66988a374a462b0b5376 1584 empty-moov-content
> write_data len 148, time nopts, type trailer atom -
> write_data len 1159, time nopts, type header atom ftyp
> 351ae2c8b6d35d98b4848c309cce6704 1159 delay-moov-header
> write_data len 796, time 0, type sync atom moof
> write_data len 788, time 1000000, type sync atom moof
> -a0165f4a26a409212b0946e981bdefb9 1584 delay-moov-content
> +289ee982188d66988a374a462b0b5376 1584 delay-moov-content
> write_data len 148, time nopts, type trailer atom -
> write_data len 28, time nopts, type header atom -
> write_data len 1123, time nopts, type header atom -
> write_data len 884, time 0, type sync atom sidx
> write_data len 876, time 1000000, type sync atom sidx
> -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag
> +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag
> write_data len 148, time nopts, type trailer atom -
> write_data len 28, time nopts, type header atom -
> write_data len 1123, time nopts, type header atom -
> write_data len 876, time 1000000, type sync atom sidx
> -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag-discont
> +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag-discont
> write_data len 110, time nopts, type trailer atom -
> write_data len 1223, time nopts, type header atom -
> write_data len 876, time 1000000, type sync atom sidx
> -272a474cfd2a68cc5f05b426b14a2b7d 876 delay-moov-second-frag-discont
> +c0307f99a2a362205b7e3d65b1066f86 876 delay-moov-second-frag-discont
> write_data len 110, time nopts, type trailer atom -
> write_data len 1223, time nopts, type header atom ftyp
> b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init
> write_data len 988, time -33333, type sync atom sidx
> write_data len 996, time 966667, type sync atom sidx
> -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag
> +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag
> write_data len 148, time nopts, type trailer atom -
> write_data len 1223, time nopts, type header atom ftyp
> b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init-discont
> write_data len 996, time 966667, type sync atom sidx
> -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag-discont
> +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag-discont
> write_data len 110, time nopts, type trailer atom -
> write_data len 1223, time nopts, type header atom ftyp
> 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init
> write_data len 1004, time -33333, type sync atom sidx
> write_data len 996, time 966667, type sync atom sidx
> -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag
> +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag
> write_data len 148, time nopts, type trailer atom -
> write_data len 1223, time nopts, type header atom ftyp
> 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init-discont
> write_data len 996, time 966667, type sync atom sidx
> -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag-discont
> +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag-discont
> write_data len 110, time nopts, type trailer atom -
> write_data len 1247, time nopts, type header atom ftyp
> 80511a51d1ac9cde62337eed7176ae03 1247 delay-moov-elst-signal-init-discont-largets
> write_data len 996, time 279621233333, type sync atom sidx
> -41cac4c3df656a87bb38363fdcd745e6 996 delay-moov-elst-signal-second-frag-discont-largets
> +dc695d65e8a0cdafee28acd8a5ccf81a 996 delay-moov-elst-signal-second-frag-discont-largets
> write_data len 110, time nopts, type trailer atom -
> write_data len 1223, time nopts, type header atom ftyp
> write_data len 2572, time -333333, type sync atom sidx
> write_data len 996, time 5166667, type sync atom sidx
> write_data len 148, time nopts, type trailer atom -
> -c3eb39921c90724784d1ab84fac58b34 4939 vfr
> +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr
> write_data len 1223, time nopts, type header atom ftyp
> write_data len 2572, time -333333, type sync atom sidx
> write_data len 996, time 5166667, type sync atom sidx
> write_data len 148, time nopts, type trailer atom -
> -c3eb39921c90724784d1ab84fac58b34 4939 vfr-noduration
> +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr-noduration
> write_data len 1231, time nopts, type header atom ftyp
> write_data len 1500, time -333333, type sync atom moof
> write_data len 1500, time nopts, type unknown atom -
> @@ -131,7 +131,7 @@ write_data len 1500, time 9666667, type sync atom moof
> write_data len 1500, time nopts, type unknown atom -
> write_data len 1004, time nopts, type unknown atom -
> write_data len 148, time nopts, type trailer atom -
> -5bde1358e246e715b2096daa321c9f1b 9299 large_frag
> +08b6401dc81912e5264245b7233c4ab3 9299 large_frag
> write_data len 1231, time nopts, type header atom ftyp
> write_data len 684, time -33333, type sync atom moof
> write_data len 504, time 800000, type boundary atom moof
> @@ -139,15 +139,15 @@ write_data len 420, time 1266667, type boundary atom moof
> write_data len 668, time 1566667, type sync atom moof
> write_data len 440, time 2233333, type boundary atom moof
> write_data len 262, time nopts, type trailer atom -
> -47cc2460c4b18390c67991cf3251409b 4209 vfr-noduration-interleave
> +a5d087611a9229ba91eb0964cf2f17d9 4209 vfr-noduration-interleave
> write_data len 1231, time nopts, type header atom ftyp
> write_data len 916, time 0, type sync atom moof
> write_data len 908, time 1000000, type sync atom moof
> write_data len 148, time nopts, type trailer atom -
> -c200a345c365dd35a31e7e62a9ae6c10 3203 delay-moov-elst-neg-cts
> +d81c3a0ce5940a2db74c99ad435e0560 3203 delay-moov-elst-neg-cts
> write_data len 36, time nopts, type header atom ftyp
> write_data len 1123, time nopts, type header atom -
> write_data len 900, time 0, type sync atom moof
> write_data len 908, time 1000000, type sync atom moof
> write_data len 148, time nopts, type trailer atom -
> -868bb53d861d81b1c15ef4d59afc83b5 3115 empty-moov-neg-cts
> +3be575022e446855bca1e45b7942cc0c 3115 empty-moov-neg-cts
> diff --git a/tests/ref/fate/sub2video b/tests/ref/fate/sub2video
> index 4e034a5..80abe9c 100644
> --- a/tests/ref/fate/sub2video
> +++ b/tests/ref/fate/sub2video
> @@ -10,7 +10,7 @@
> 0,          0,          0,        1,   518400, 0x83c27b82
> 0,          1,          1,        1,   518400, 0x4051c7f9
> 0,          2,          2,        1,   518400, 0xfb00e17e
> -1,     499000,     499000,  4960000,     1015, 0x19e092d2, F=0x0
> +1,     499000,     499000,  4960000,     1015, 0x19e092d2
> 0,          3,          3,        1,   518400, 0x192abb74
> 0,          4,          4,        1,   518400, 0x4669a88b
> 0,          5,          5,        1,   518400, 0xaababe00
> @@ -58,129 +58,129 @@
> 0,         47,         47,        1,   518400, 0xde69683f
> 0,         48,         48,        1,   518400, 0x7df08fba
> 0,         49,         49,        1,   518400, 0xbab197ea
> -1,   15355000,   15355000,  4733000,     2094, 0x3c171425, F=0x0
> +1,   15355000,   15355000,  4733000,     2094, 0x3c171425
> 0,         77,         77,        1,   518400, 0x902285d9
> 0,        100,        100,        1,   518400, 0xbab197ea
> -1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21, F=0x0
> +1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21
> 0,        244,        244,        1,   518400, 0x7a11c812
> 0,        257,        257,        1,   518400, 0xbab197ea
> -1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05, F=0x0
> +1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05
> 0,        258,        258,        1,   518400, 0x34cdddee
> 0,        269,        269,        1,   518400, 0xbab197ea
> -1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed, F=0x0
> +1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed
> 0,        270,        270,        1,   518400, 0x4db4ce51
> 0,        283,        283,        1,   518400, 0xbab197ea
> -1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7, F=0x0
> +1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7
> 0,        284,        284,        1,   518400, 0xe6bc0ea9
> 0,        290,        290,        1,   518400, 0xbab197ea
> -1,   58014000,   58014000,  1661000,      969, 0xe01878f0, F=0x0
> +1,   58014000,   58014000,  1661000,      969, 0xe01878f0
> 0,        291,        291,        1,   518400, 0xa8643af7
> 0,        298,        298,        1,   518400, 0xbab197ea
> -1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1, F=0x0
> +1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1
> 0,        339,        339,        1,   518400, 0xb1885c67
> 0,        345,        345,        1,   518400, 0xbab197ea
> -1,   69175000,   69175000,  1558000,      802, 0xf48531ba, F=0x0
> +1,   69175000,   69175000,  1558000,      802, 0xf48531ba
> 0,        346,        346,        1,   518400, 0x378e3fd0
> 0,        354,        354,        1,   518400, 0xbab197ea
> -1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd, F=0x0
> +1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd
> 0,        355,        355,        1,   518400, 0xa3782469
> 0,        363,        363,        1,   518400, 0xbab197ea
> -1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82, F=0x0
> +1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82
> 0,        364,        364,        1,   518400, 0xba23a0d5
> 0,        374,        374,        1,   518400, 0xbab197ea
> -1,   74806000,   74806000,  1831000,     2116, 0x96514097, F=0x0
> +1,   74806000,   74806000,  1831000,     2116, 0x96514097
> 0,        375,        375,        1,   518400, 0x129de2f8
> 0,        383,        383,        1,   518400, 0xbab197ea
> -1,   76716000,   76716000,  1262000,     1822, 0xefccc72e, F=0x0
> +1,   76716000,   76716000,  1262000,     1822, 0xefccc72e
> 0,        384,        384,        1,   518400, 0x19772f0f
> 0,        390,        390,        1,   518400, 0xbab197ea
> -1,   78051000,   78051000,  1524000,      987, 0x7b927a27, F=0x0
> +1,   78051000,   78051000,  1524000,      987, 0x7b927a27
> 0,        391,        391,        1,   518400, 0x56f54e73
> 0,        398,        398,        1,   518400, 0xbab197ea
> -1,   79644000,   79644000,  2662000,     2956, 0x190778f7, F=0x0
> +1,   79644000,   79644000,  2662000,     2956, 0x190778f7
> 0,        399,        399,        1,   518400, 0x300b5247
> -1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3, F=0x0
> +1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3
> 0,        412,        412,        1,   518400, 0xbab197ea
> 0,        413,        413,        1,   518400, 0x6fd028fa
> 0,        426,        426,        1,   518400, 0xbab197ea
> -1,   85225000,   85225000,  2366000,     2585, 0x74d0048f, F=0x0
> +1,   85225000,   85225000,  2366000,     2585, 0x74d0048f
> 0,        427,        427,        1,   518400, 0x01f80e9d
> 0,        438,        438,        1,   518400, 0xbab197ea
> -1,   87652000,   87652000,  1831000,      634, 0x8832fda1, F=0x0
> +1,   87652000,   87652000,  1831000,      634, 0x8832fda1
> 0,        439,        439,        1,   518400, 0xb48d90c0
> 0,        447,        447,        1,   518400, 0xbab197ea
> -1,   91531000,   91531000,  2332000,     2080, 0x97a1146f, F=0x0
> +1,   91531000,   91531000,  2332000,     2080, 0x97a1146f
> 0,        458,        458,        1,   518400, 0xcb5a0173
> 0,        469,        469,        1,   518400, 0xbab197ea
> -1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684, F=0x0
> +1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684
> 0,        478,        478,        1,   518400, 0xb8a323e4
> 0,        494,        494,        1,   518400, 0xbab197ea
> -1,   98872000,   98872000,  2161000,     1875, 0x9002ef71, F=0x0
> +1,   98872000,   98872000,  2161000,     1875, 0x9002ef71
> 0,        495,        495,        1,   518400, 0xc43518ba
> 0,        505,        505,        1,   518400, 0xbab197ea
> -1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c, F=0x0
> +1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c
> 0,        506,        506,        1,   518400, 0x04e38692
> 0,        526,        526,        1,   518400, 0xbab197ea
> -1,  105303000,  105303000,  2730000,     3094, 0xf203a663, F=0x0
> +1,  105303000,  105303000,  2730000,     3094, 0xf203a663
> 0,        527,        527,        1,   518400, 0x856b0ee5
> 0,        540,        540,        1,   518400, 0xbab197ea
> -1,  108106000,  108106000,  2059000,     2404, 0x41a7b429, F=0x0
> +1,  108106000,  108106000,  2059000,     2404, 0x41a7b429
> 0,        541,        541,        1,   518400, 0x3e5beee2
> 0,        551,        551,        1,   518400, 0xbab197ea
> -1,  141556000,  141556000,  1661000,     1088, 0xde20aa20, F=0x0
> +1,  141556000,  141556000,  1661000,     1088, 0xde20aa20
> 0,        708,        708,        1,   518400, 0xb8bc1365
> 0,        716,        716,        1,   518400, 0xbab197ea
> 0,        817,        817,        1,   518400, 0x83efa32d
> -1,  163445000,  163445000,  1331000,      339, 0x8bd186ef, F=0x0
> +1,  163445000,  163445000,  1331000,      339, 0x8bd186ef
> 0,        824,        824,        1,   518400, 0xbab197ea
> 0,        840,        840,        1,   518400, 0x03ea0e90
> -1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d, F=0x0
> +1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d
> 0,        850,        850,        1,   518400, 0xbab197ea
> -1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe, F=0x0
> +1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe
> 0,        851,        851,        1,   518400, 0x8780239e
> 0,        858,        858,        1,   518400, 0xbab197ea
> 0,        861,        861,        1,   518400, 0x6eb72347
> -1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769, F=0x0
> +1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769
> 0,        869,        869,        1,   518400, 0xbab197ea
> -1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc, F=0x0
> +1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc
> 0,        870,        870,        1,   518400, 0x9c4a3a3d
> 0,        879,        879,        1,   518400, 0xbab197ea
> -1,  175957000,  175957000,  1763000,     1019, 0x20409355, F=0x0
> +1,  175957000,  175957000,  1763000,     1019, 0x20409355
> 0,        880,        880,        1,   518400, 0xc9ebfa89
> 0,        889,        889,        1,   518400, 0xbab197ea
> 0,        946,        946,        1,   518400, 0xbaf801ef
> -1,  189295000,  189295000,  1968000,     1596, 0x408c726e, F=0x0
> +1,  189295000,  189295000,  1968000,     1596, 0x408c726e
> 0,        956,        956,        1,   518400, 0xbab197ea
> -1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b, F=0x0
> +1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b
> 0,        957,        957,        1,   518400, 0x59f4e72f
> 0,        963,        963,        1,   518400, 0xbab197ea
> -1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4, F=0x0
> +1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4
> 0,        964,        964,        1,   518400, 0x9d5b9d69
> 0,        972,        972,        1,   518400, 0xbab197ea
> -1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8, F=0x0
> +1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8
> 0,        976,        976,        1,   518400, 0x923d1ce7
> 0,        981,        981,        1,   518400, 0xbab197ea
> -1,  196361000,  196361000,  1524000,     1715, 0x695ca41e, F=0x0
> +1,  196361000,  196361000,  1524000,     1715, 0x695ca41e
> 0,        982,        982,        1,   518400, 0x6e652cd2
> 0,        989,        989,        1,   518400, 0xbab197ea
> -1,  197946000,  197946000,  1160000,      789, 0xc63a189e, F=0x0
> +1,  197946000,  197946000,  1160000,      789, 0xc63a189e
> 0,        990,        990,        1,   518400, 0x25113966
> 0,        996,        996,        1,   518400, 0xbab197ea
> -1,  199230000,  199230000,  1627000,     1846, 0xeea8c599, F=0x0
> +1,  199230000,  199230000,  1627000,     1846, 0xeea8c599
> 0,        997,        997,        1,   518400, 0x2dc83609
> 0,       1004,       1004,        1,   518400, 0xbab197ea
> -1,  200924000,  200924000,  1763000,      922, 0xd4a87222, F=0x0
> +1,  200924000,  200924000,  1763000,      922, 0xd4a87222
> 0,       1005,       1005,        1,   518400, 0x90483bc6
> 0,       1013,       1013,        1,   518400, 0xbab197ea
> 0,       1053,       1053,        1,   518400, 0x3de86ab7
> -1,  210600000,  210600000,  1831000,      665, 0x55580135, F=0x0
> +1,  210600000,  210600000,  1831000,      665, 0x55580135
> 0,       1062,       1062,        1,   518400, 0xbab197ea
> -1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5, F=0x0
> +1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5
> 0,       1074,       1074,        1,   518400, 0x8c320e68
> 0,       1082,       1082,        1,   518400, 0xbab197ea
> 0,       1128,       1128,        1,   518400, 0x81e977b2
> -1,  225640000,  225640000,  2127000,     2133, 0x670c11a5, F=0x0
> +1,  225640000,  225640000,  2127000,     2133, 0x670c11a5
> 0,       1139,       1139,        1,   518400, 0xbab197ea
> -1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57, F=0x0
> +1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57
> 0,       1140,       1140,        1,   518400, 0xb046dd30
> 0,       1145,       1145,        1,   518400, 0xbab197ea
> -- 
> 2.9.5
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Lance Wang May 6, 2020, 2:28 p.m. UTC | #3
On Wed, May 06, 2020 at 10:11:22AM +0200, Marton Balint wrote:
> 
> 
> On Tue, 21 Apr 2020, lance.lmwang@gmail.com wrote:
> 
> > From: Limin Wang <lance.lmwang@gmail.com>
> > 
> > The patch will make audio and subtitle packets be marked as AV_PKT_FLAG_KEY.
> 
> Why the subtitles? Is it possible that the patch description is outdated? I
> don't see from the code how would this apply to subtitles, after all
> is_intra_only only check for audio and video, no?

No, is_intra_only() check for subtitle also. It'll return 0 for audio and video
and not AV_CODEC_PROP_INTRA_ONLY, other will return 1(is_intra).


> 
> Thanks,
> Marton
> 
> > 
> > For audio, it'll caused the audio sample to be sync sample.
> > To verify ref/fate/movenc results:
> > 1. Get the movenc test data
> > [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_old && mv *.mp4 audio_old_
> > 
> > After applied the patch:
> > [lmwang@vpn ffmpeg]$ make fate-movenc SAMPLES=../fate-suite
> > [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_key && mv *.mp4 audio_key
> > 
> > 2. Get l-smash and build boxdumper
> > https://github.com/l-smash/l-smash.git
> > 
> > 3. dump the box of crc change mp4 and diff -u
> > [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_key/non-empty-moov-no-elst.mp4  > audio_key/non-empty-moov-no-elst.log
> > [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_old/non-empty-moov-no-elst.mp4  > audio_old/non-empty-moov-no-elst.log
> > [lmwang@vpn ffmpeg]$ diff -u audio_key/non-empty-moov-no-elst.log audio_old/non-empty-moov-no-elst.log
> > -                default_sample_flags = 0x02000000
> > -                    independent
> > -                    sync sample
> > +                default_sample_flags = 0x01010000
> > +                    dependent
> > +                    non-sync sample
> > 
> > 4. have checked the change of crc are caused by default_sample_flags
> > non-empty-moov.mp4, non-empty-moov-elst.mp4,
> > non-empty-moov-no-elst.mp4, empty-moov.mp4, delay-moov-content.mp4,
> > empty-moov-second-frag.mp4, empty-moov-second-frag-discont.mp4,
> > delay-moov-second-frag-discont.mp4, delay-moov-elst-second-frag.mp4
> > etc
> > 
> > 5 For subtitle, it'll effect for tests/ref/fate/binsub-movtextenc and
> > tests/ref/fate/sub2video, that's expecting result for the subtitle is
> > marked as keyframe. Below is the checking result of binsub-movtextenc:
> > 
> > [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_key/binsub-movtextenc.mp4
> > [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_old/binsub-movtextenc.mp4
> > [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_key/binsub-movtextenc.mp4  > audio_key/binsub-movtextenc.log
> > [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_old/binsub-movtextenc.mp4  > audio_old/binsub-movtextenc.log
> > [lmwang@vpn ffmpeg]$ diff -u audio_key/binsub-movtextenc.log audio_old/binsub-movtextenc.log
> > .... // the key difference is the flag for sync sample
> > -                flags = 0x000701
> > +                flags = 0x000301
> >                     data-offset-present
> >                     sample-duration-present
> >                     sample-size-present
> > -                    sample-flags-present
> >                 sample_count = 6
> > -                data_offset = 188
> > +                data_offset = 164
> >                 sample[0]
> >                     sample_duration = 1570000
> >                     sample_size = 21
> > -                    sample_flags = 0x02000000
> > -                        independent
> > -                        sync sample
> > -                        degradation_priority = 0
> >                 sample[1]
> >                     sample_duration = 510000
> >                     sample_size = 2
> > -                    sample_flags = 0x01010000
> > -                        dependent
> > -                        non-sync sample
> > -                        degradation_priority = 0
> >                 sample[2]
> >                     sample_duration = 1690000
> >                     sample_size = 9
> > -                    sample_flags = 0x02000000
> > -                        independent
> > -                        sync sample
> > -                        degradation_priority = 0
> > 
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> > libavformat/internal.h           |  2 +
> > libavformat/mux.c                |  7 +++-
> > tests/ref/fate/binsub-movtextenc |  2 +-
> > tests/ref/fate/movenc            | 50 +++++++++++------------
> > tests/ref/fate/sub2video         | 86 ++++++++++++++++++++--------------------
> > 5 files changed, 77 insertions(+), 70 deletions(-)
> > 
> > diff --git a/libavformat/internal.h b/libavformat/internal.h
> > index 716e42c..c4fac5c 100644
> > --- a/libavformat/internal.h
> > +++ b/libavformat/internal.h
> > @@ -189,6 +189,8 @@ struct AVStreamInternal {
> >      */
> >     int need_context_update;
> > 
> > +    int is_intra_only;
> > +
> >     FFFrac *priv_pts;
> > };
> > 
> > diff --git a/libavformat/mux.c b/libavformat/mux.c
> > index a6253f5..ea6524f 100644
> > --- a/libavformat/mux.c
> > +++ b/libavformat/mux.c
> > @@ -357,6 +357,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
> >         if (desc && desc->props & AV_CODEC_PROP_REORDER)
> >             st->internal->reorder = 1;
> > 
> > +        st->internal->is_intra_only = ff_is_intra_only(par->codec_id);
> > +
> >         if (of->codec_tag) {
> >             if (   par->codec_tag
> >                 && par->codec_id == AV_CODEC_ID_RAWVIDEO
> > @@ -773,6 +775,7 @@ static int check_packet(AVFormatContext *s, AVPacket *pkt)
> > static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
> > {
> >     int ret;
> > +    AVStream *st = s->streams[pkt->stream_index];
> > 
> >     ret = check_packet(s, pkt);
> >     if (ret < 0)
> > @@ -781,7 +784,6 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
> > #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
> >     /* sanitize the timestamps */
> >     if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
> > -        AVStream *st = s->streams[pkt->stream_index];
> > 
> >         /* when there is no reordering (so dts is equal to pts), but
> >          * only one of them is set, set the other as well */
> > @@ -818,6 +820,9 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
> >         }
> >     }
> > #endif
> > +    /* update flags */
> > +    if (st->internal->is_intra_only)
> > +        pkt->flags |= AV_PKT_FLAG_KEY;
> > 
> >     return 0;
> > }
> > diff --git a/tests/ref/fate/binsub-movtextenc b/tests/ref/fate/binsub-movtextenc
> > index 78c05f4..a8f94b7 100644
> > --- a/tests/ref/fate/binsub-movtextenc
> > +++ b/tests/ref/fate/binsub-movtextenc
> > @@ -1 +1 @@
> > -35adf776cd73e808186ae7124445f4b8
> > +fc6d07679ac1f718aa50de687924cd97
> > diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
> > index 637a347..fb39b98 100644
> > --- a/tests/ref/fate/movenc
> > +++ b/tests/ref/fate/movenc
> > @@ -2,17 +2,17 @@ write_data len 36, time nopts, type header atom ftyp
> > write_data len 2389, time nopts, type header atom -
> > write_data len 788, time 1000000, type sync atom moof
> > write_data len 110, time nopts, type trailer atom -
> > -66cf48604f039aa9a51711786f5c8778 3323 non-empty-moov
> > +5f401347fc3c771b819e2449d69d4861 3323 non-empty-moov
> > write_data len 36, time nopts, type header atom ftyp
> > write_data len 2721, time nopts, type header atom -
> > write_data len 908, time 966667, type sync atom moof
> > write_data len 110, time nopts, type trailer atom -
> > -04b2e86f455af94f9258b8d66dbf71f5 3775 non-empty-moov-elst
> > +4267feee527adf8cd4f7b36ac0fc0872 3775 non-empty-moov-elst
> > write_data len 36, time nopts, type header atom ftyp
> > write_data len 2629, time nopts, type header atom -
> > write_data len 908, time 1000000, type sync atom moof
> > write_data len 110, time nopts, type trailer atom -
> > -e9f6fa032d6d8265d67aef5de81a48bf 3683 non-empty-moov-no-elst
> > +44077b9ad45f3e16fafe4e5ada54e9b0 3683 non-empty-moov-no-elst
> > write_data len 24, time nopts, type header atom ftyp
> > write_data len 1171, time nopts, type header atom -
> > write_data len 728, time 0, type sync atom moof
> > @@ -20,35 +20,35 @@ write_data len 828, time nopts, type unknown atom -
> > write_data len 728, time 999999, type sync atom moof
> > write_data len 812, time nopts, type unknown atom -
> > write_data len 148, time nopts, type trailer atom -
> > -da105e0b2c19079519c6eed7d5a1151c 4439 ismv
> > +92ce825ff40505ec8676191705adb7e7 4439 ismv
> > write_data len 36, time nopts, type header atom ftyp
> > write_data len 1123, time nopts, type header atom -
> > write_data len 796, time 0, type sync atom moof
> > write_data len 788, time 1000000, type sync atom moof
> > write_data len 148, time nopts, type trailer atom -
> > -e6a4b15443d006efd727a80f6624b7db 2891 empty-moov
> > +08f4b3ad3a3ea224b2ee731476b9056b 2891 empty-moov
> > write_data len 36, time nopts, type header atom ftyp
> > write_data len 1123, time nopts, type header atom -
> > write_data len 1068, time 0, type sync atom moof
> > write_data len 908, time 1000000, type sync atom moof
> > write_data len 148, time nopts, type trailer atom -
> > -800f854aff2ac76dfaddebd0562c75b9 3283 empty-moov-no-elst
> > +d7a2dcb43eb0f95f92669f55fc7adeba 3283 empty-moov-no-elst
> > write_data len 36, time nopts, type header atom ftyp
> > write_data len 1123, time nopts, type header atom -
> > write_data len 900, time -33333, type sync atom moof
> > write_data len 908, time 966667, type sync atom moof
> > write_data len 148, time nopts, type trailer atom -
> > -eca1a945c9063dab0858af6b85925533 3115 empty-moov-no-elst-no-adjust
> > +ea70ca697306976879be408431c27aee 3115 empty-moov-no-elst-no-adjust
> > write_data len 1159, time nopts, type header atom ftyp
> > write_data len 796, time 0, type sync atom moof
> > write_data len 788, time 1000000, type sync atom moof
> > write_data len 148, time nopts, type trailer atom -
> > -e6a4b15443d006efd727a80f6624b7db 2891 delay-moov
> > +08f4b3ad3a3ea224b2ee731476b9056b 2891 delay-moov
> > write_data len 1231, time nopts, type header atom ftyp
> > write_data len 916, time -33333, type sync atom moof
> > write_data len 908, time 966667, type sync atom moof
> > write_data len 148, time nopts, type trailer atom -
> > -c2ecdbc80668fcee73f5a039e2dba579 3203 delay-moov-elst
> > +314cc3b6296f4ee583b328a34be50b2f 3203 delay-moov-elst
> > write_data len 1195, time nopts, type header atom ftyp
> > write_data len 836, time 0, type sync atom moof
> > write_data len 67, time nopts, type trailer atom -
> > @@ -63,66 +63,66 @@ write_data len 1123, time nopts, type header atom -
> > 351ae2c8b6d35d98b4848c309cce6704 1159 empty-moov-header
> > write_data len 796, time 0, type sync atom moof
> > write_data len 788, time 1000000, type sync atom moof
> > -a0165f4a26a409212b0946e981bdefb9 1584 empty-moov-content
> > +289ee982188d66988a374a462b0b5376 1584 empty-moov-content
> > write_data len 148, time nopts, type trailer atom -
> > write_data len 1159, time nopts, type header atom ftyp
> > 351ae2c8b6d35d98b4848c309cce6704 1159 delay-moov-header
> > write_data len 796, time 0, type sync atom moof
> > write_data len 788, time 1000000, type sync atom moof
> > -a0165f4a26a409212b0946e981bdefb9 1584 delay-moov-content
> > +289ee982188d66988a374a462b0b5376 1584 delay-moov-content
> > write_data len 148, time nopts, type trailer atom -
> > write_data len 28, time nopts, type header atom -
> > write_data len 1123, time nopts, type header atom -
> > write_data len 884, time 0, type sync atom sidx
> > write_data len 876, time 1000000, type sync atom sidx
> > -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag
> > +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag
> > write_data len 148, time nopts, type trailer atom -
> > write_data len 28, time nopts, type header atom -
> > write_data len 1123, time nopts, type header atom -
> > write_data len 876, time 1000000, type sync atom sidx
> > -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag-discont
> > +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag-discont
> > write_data len 110, time nopts, type trailer atom -
> > write_data len 1223, time nopts, type header atom -
> > write_data len 876, time 1000000, type sync atom sidx
> > -272a474cfd2a68cc5f05b426b14a2b7d 876 delay-moov-second-frag-discont
> > +c0307f99a2a362205b7e3d65b1066f86 876 delay-moov-second-frag-discont
> > write_data len 110, time nopts, type trailer atom -
> > write_data len 1223, time nopts, type header atom ftyp
> > b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init
> > write_data len 988, time -33333, type sync atom sidx
> > write_data len 996, time 966667, type sync atom sidx
> > -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag
> > +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag
> > write_data len 148, time nopts, type trailer atom -
> > write_data len 1223, time nopts, type header atom ftyp
> > b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init-discont
> > write_data len 996, time 966667, type sync atom sidx
> > -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag-discont
> > +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag-discont
> > write_data len 110, time nopts, type trailer atom -
> > write_data len 1223, time nopts, type header atom ftyp
> > 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init
> > write_data len 1004, time -33333, type sync atom sidx
> > write_data len 996, time 966667, type sync atom sidx
> > -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag
> > +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag
> > write_data len 148, time nopts, type trailer atom -
> > write_data len 1223, time nopts, type header atom ftyp
> > 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init-discont
> > write_data len 996, time 966667, type sync atom sidx
> > -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag-discont
> > +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag-discont
> > write_data len 110, time nopts, type trailer atom -
> > write_data len 1247, time nopts, type header atom ftyp
> > 80511a51d1ac9cde62337eed7176ae03 1247 delay-moov-elst-signal-init-discont-largets
> > write_data len 996, time 279621233333, type sync atom sidx
> > -41cac4c3df656a87bb38363fdcd745e6 996 delay-moov-elst-signal-second-frag-discont-largets
> > +dc695d65e8a0cdafee28acd8a5ccf81a 996 delay-moov-elst-signal-second-frag-discont-largets
> > write_data len 110, time nopts, type trailer atom -
> > write_data len 1223, time nopts, type header atom ftyp
> > write_data len 2572, time -333333, type sync atom sidx
> > write_data len 996, time 5166667, type sync atom sidx
> > write_data len 148, time nopts, type trailer atom -
> > -c3eb39921c90724784d1ab84fac58b34 4939 vfr
> > +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr
> > write_data len 1223, time nopts, type header atom ftyp
> > write_data len 2572, time -333333, type sync atom sidx
> > write_data len 996, time 5166667, type sync atom sidx
> > write_data len 148, time nopts, type trailer atom -
> > -c3eb39921c90724784d1ab84fac58b34 4939 vfr-noduration
> > +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr-noduration
> > write_data len 1231, time nopts, type header atom ftyp
> > write_data len 1500, time -333333, type sync atom moof
> > write_data len 1500, time nopts, type unknown atom -
> > @@ -131,7 +131,7 @@ write_data len 1500, time 9666667, type sync atom moof
> > write_data len 1500, time nopts, type unknown atom -
> > write_data len 1004, time nopts, type unknown atom -
> > write_data len 148, time nopts, type trailer atom -
> > -5bde1358e246e715b2096daa321c9f1b 9299 large_frag
> > +08b6401dc81912e5264245b7233c4ab3 9299 large_frag
> > write_data len 1231, time nopts, type header atom ftyp
> > write_data len 684, time -33333, type sync atom moof
> > write_data len 504, time 800000, type boundary atom moof
> > @@ -139,15 +139,15 @@ write_data len 420, time 1266667, type boundary atom moof
> > write_data len 668, time 1566667, type sync atom moof
> > write_data len 440, time 2233333, type boundary atom moof
> > write_data len 262, time nopts, type trailer atom -
> > -47cc2460c4b18390c67991cf3251409b 4209 vfr-noduration-interleave
> > +a5d087611a9229ba91eb0964cf2f17d9 4209 vfr-noduration-interleave
> > write_data len 1231, time nopts, type header atom ftyp
> > write_data len 916, time 0, type sync atom moof
> > write_data len 908, time 1000000, type sync atom moof
> > write_data len 148, time nopts, type trailer atom -
> > -c200a345c365dd35a31e7e62a9ae6c10 3203 delay-moov-elst-neg-cts
> > +d81c3a0ce5940a2db74c99ad435e0560 3203 delay-moov-elst-neg-cts
> > write_data len 36, time nopts, type header atom ftyp
> > write_data len 1123, time nopts, type header atom -
> > write_data len 900, time 0, type sync atom moof
> > write_data len 908, time 1000000, type sync atom moof
> > write_data len 148, time nopts, type trailer atom -
> > -868bb53d861d81b1c15ef4d59afc83b5 3115 empty-moov-neg-cts
> > +3be575022e446855bca1e45b7942cc0c 3115 empty-moov-neg-cts
> > diff --git a/tests/ref/fate/sub2video b/tests/ref/fate/sub2video
> > index 4e034a5..80abe9c 100644
> > --- a/tests/ref/fate/sub2video
> > +++ b/tests/ref/fate/sub2video
> > @@ -10,7 +10,7 @@
> > 0,          0,          0,        1,   518400, 0x83c27b82
> > 0,          1,          1,        1,   518400, 0x4051c7f9
> > 0,          2,          2,        1,   518400, 0xfb00e17e
> > -1,     499000,     499000,  4960000,     1015, 0x19e092d2, F=0x0
> > +1,     499000,     499000,  4960000,     1015, 0x19e092d2
> > 0,          3,          3,        1,   518400, 0x192abb74
> > 0,          4,          4,        1,   518400, 0x4669a88b
> > 0,          5,          5,        1,   518400, 0xaababe00
> > @@ -58,129 +58,129 @@
> > 0,         47,         47,        1,   518400, 0xde69683f
> > 0,         48,         48,        1,   518400, 0x7df08fba
> > 0,         49,         49,        1,   518400, 0xbab197ea
> > -1,   15355000,   15355000,  4733000,     2094, 0x3c171425, F=0x0
> > +1,   15355000,   15355000,  4733000,     2094, 0x3c171425
> > 0,         77,         77,        1,   518400, 0x902285d9
> > 0,        100,        100,        1,   518400, 0xbab197ea
> > -1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21, F=0x0
> > +1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21
> > 0,        244,        244,        1,   518400, 0x7a11c812
> > 0,        257,        257,        1,   518400, 0xbab197ea
> > -1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05, F=0x0
> > +1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05
> > 0,        258,        258,        1,   518400, 0x34cdddee
> > 0,        269,        269,        1,   518400, 0xbab197ea
> > -1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed, F=0x0
> > +1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed
> > 0,        270,        270,        1,   518400, 0x4db4ce51
> > 0,        283,        283,        1,   518400, 0xbab197ea
> > -1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7, F=0x0
> > +1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7
> > 0,        284,        284,        1,   518400, 0xe6bc0ea9
> > 0,        290,        290,        1,   518400, 0xbab197ea
> > -1,   58014000,   58014000,  1661000,      969, 0xe01878f0, F=0x0
> > +1,   58014000,   58014000,  1661000,      969, 0xe01878f0
> > 0,        291,        291,        1,   518400, 0xa8643af7
> > 0,        298,        298,        1,   518400, 0xbab197ea
> > -1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1, F=0x0
> > +1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1
> > 0,        339,        339,        1,   518400, 0xb1885c67
> > 0,        345,        345,        1,   518400, 0xbab197ea
> > -1,   69175000,   69175000,  1558000,      802, 0xf48531ba, F=0x0
> > +1,   69175000,   69175000,  1558000,      802, 0xf48531ba
> > 0,        346,        346,        1,   518400, 0x378e3fd0
> > 0,        354,        354,        1,   518400, 0xbab197ea
> > -1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd, F=0x0
> > +1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd
> > 0,        355,        355,        1,   518400, 0xa3782469
> > 0,        363,        363,        1,   518400, 0xbab197ea
> > -1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82, F=0x0
> > +1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82
> > 0,        364,        364,        1,   518400, 0xba23a0d5
> > 0,        374,        374,        1,   518400, 0xbab197ea
> > -1,   74806000,   74806000,  1831000,     2116, 0x96514097, F=0x0
> > +1,   74806000,   74806000,  1831000,     2116, 0x96514097
> > 0,        375,        375,        1,   518400, 0x129de2f8
> > 0,        383,        383,        1,   518400, 0xbab197ea
> > -1,   76716000,   76716000,  1262000,     1822, 0xefccc72e, F=0x0
> > +1,   76716000,   76716000,  1262000,     1822, 0xefccc72e
> > 0,        384,        384,        1,   518400, 0x19772f0f
> > 0,        390,        390,        1,   518400, 0xbab197ea
> > -1,   78051000,   78051000,  1524000,      987, 0x7b927a27, F=0x0
> > +1,   78051000,   78051000,  1524000,      987, 0x7b927a27
> > 0,        391,        391,        1,   518400, 0x56f54e73
> > 0,        398,        398,        1,   518400, 0xbab197ea
> > -1,   79644000,   79644000,  2662000,     2956, 0x190778f7, F=0x0
> > +1,   79644000,   79644000,  2662000,     2956, 0x190778f7
> > 0,        399,        399,        1,   518400, 0x300b5247
> > -1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3, F=0x0
> > +1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3
> > 0,        412,        412,        1,   518400, 0xbab197ea
> > 0,        413,        413,        1,   518400, 0x6fd028fa
> > 0,        426,        426,        1,   518400, 0xbab197ea
> > -1,   85225000,   85225000,  2366000,     2585, 0x74d0048f, F=0x0
> > +1,   85225000,   85225000,  2366000,     2585, 0x74d0048f
> > 0,        427,        427,        1,   518400, 0x01f80e9d
> > 0,        438,        438,        1,   518400, 0xbab197ea
> > -1,   87652000,   87652000,  1831000,      634, 0x8832fda1, F=0x0
> > +1,   87652000,   87652000,  1831000,      634, 0x8832fda1
> > 0,        439,        439,        1,   518400, 0xb48d90c0
> > 0,        447,        447,        1,   518400, 0xbab197ea
> > -1,   91531000,   91531000,  2332000,     2080, 0x97a1146f, F=0x0
> > +1,   91531000,   91531000,  2332000,     2080, 0x97a1146f
> > 0,        458,        458,        1,   518400, 0xcb5a0173
> > 0,        469,        469,        1,   518400, 0xbab197ea
> > -1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684, F=0x0
> > +1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684
> > 0,        478,        478,        1,   518400, 0xb8a323e4
> > 0,        494,        494,        1,   518400, 0xbab197ea
> > -1,   98872000,   98872000,  2161000,     1875, 0x9002ef71, F=0x0
> > +1,   98872000,   98872000,  2161000,     1875, 0x9002ef71
> > 0,        495,        495,        1,   518400, 0xc43518ba
> > 0,        505,        505,        1,   518400, 0xbab197ea
> > -1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c, F=0x0
> > +1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c
> > 0,        506,        506,        1,   518400, 0x04e38692
> > 0,        526,        526,        1,   518400, 0xbab197ea
> > -1,  105303000,  105303000,  2730000,     3094, 0xf203a663, F=0x0
> > +1,  105303000,  105303000,  2730000,     3094, 0xf203a663
> > 0,        527,        527,        1,   518400, 0x856b0ee5
> > 0,        540,        540,        1,   518400, 0xbab197ea
> > -1,  108106000,  108106000,  2059000,     2404, 0x41a7b429, F=0x0
> > +1,  108106000,  108106000,  2059000,     2404, 0x41a7b429
> > 0,        541,        541,        1,   518400, 0x3e5beee2
> > 0,        551,        551,        1,   518400, 0xbab197ea
> > -1,  141556000,  141556000,  1661000,     1088, 0xde20aa20, F=0x0
> > +1,  141556000,  141556000,  1661000,     1088, 0xde20aa20
> > 0,        708,        708,        1,   518400, 0xb8bc1365
> > 0,        716,        716,        1,   518400, 0xbab197ea
> > 0,        817,        817,        1,   518400, 0x83efa32d
> > -1,  163445000,  163445000,  1331000,      339, 0x8bd186ef, F=0x0
> > +1,  163445000,  163445000,  1331000,      339, 0x8bd186ef
> > 0,        824,        824,        1,   518400, 0xbab197ea
> > 0,        840,        840,        1,   518400, 0x03ea0e90
> > -1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d, F=0x0
> > +1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d
> > 0,        850,        850,        1,   518400, 0xbab197ea
> > -1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe, F=0x0
> > +1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe
> > 0,        851,        851,        1,   518400, 0x8780239e
> > 0,        858,        858,        1,   518400, 0xbab197ea
> > 0,        861,        861,        1,   518400, 0x6eb72347
> > -1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769, F=0x0
> > +1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769
> > 0,        869,        869,        1,   518400, 0xbab197ea
> > -1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc, F=0x0
> > +1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc
> > 0,        870,        870,        1,   518400, 0x9c4a3a3d
> > 0,        879,        879,        1,   518400, 0xbab197ea
> > -1,  175957000,  175957000,  1763000,     1019, 0x20409355, F=0x0
> > +1,  175957000,  175957000,  1763000,     1019, 0x20409355
> > 0,        880,        880,        1,   518400, 0xc9ebfa89
> > 0,        889,        889,        1,   518400, 0xbab197ea
> > 0,        946,        946,        1,   518400, 0xbaf801ef
> > -1,  189295000,  189295000,  1968000,     1596, 0x408c726e, F=0x0
> > +1,  189295000,  189295000,  1968000,     1596, 0x408c726e
> > 0,        956,        956,        1,   518400, 0xbab197ea
> > -1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b, F=0x0
> > +1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b
> > 0,        957,        957,        1,   518400, 0x59f4e72f
> > 0,        963,        963,        1,   518400, 0xbab197ea
> > -1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4, F=0x0
> > +1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4
> > 0,        964,        964,        1,   518400, 0x9d5b9d69
> > 0,        972,        972,        1,   518400, 0xbab197ea
> > -1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8, F=0x0
> > +1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8
> > 0,        976,        976,        1,   518400, 0x923d1ce7
> > 0,        981,        981,        1,   518400, 0xbab197ea
> > -1,  196361000,  196361000,  1524000,     1715, 0x695ca41e, F=0x0
> > +1,  196361000,  196361000,  1524000,     1715, 0x695ca41e
> > 0,        982,        982,        1,   518400, 0x6e652cd2
> > 0,        989,        989,        1,   518400, 0xbab197ea
> > -1,  197946000,  197946000,  1160000,      789, 0xc63a189e, F=0x0
> > +1,  197946000,  197946000,  1160000,      789, 0xc63a189e
> > 0,        990,        990,        1,   518400, 0x25113966
> > 0,        996,        996,        1,   518400, 0xbab197ea
> > -1,  199230000,  199230000,  1627000,     1846, 0xeea8c599, F=0x0
> > +1,  199230000,  199230000,  1627000,     1846, 0xeea8c599
> > 0,        997,        997,        1,   518400, 0x2dc83609
> > 0,       1004,       1004,        1,   518400, 0xbab197ea
> > -1,  200924000,  200924000,  1763000,      922, 0xd4a87222, F=0x0
> > +1,  200924000,  200924000,  1763000,      922, 0xd4a87222
> > 0,       1005,       1005,        1,   518400, 0x90483bc6
> > 0,       1013,       1013,        1,   518400, 0xbab197ea
> > 0,       1053,       1053,        1,   518400, 0x3de86ab7
> > -1,  210600000,  210600000,  1831000,      665, 0x55580135, F=0x0
> > +1,  210600000,  210600000,  1831000,      665, 0x55580135
> > 0,       1062,       1062,        1,   518400, 0xbab197ea
> > -1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5, F=0x0
> > +1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5
> > 0,       1074,       1074,        1,   518400, 0x8c320e68
> > 0,       1082,       1082,        1,   518400, 0xbab197ea
> > 0,       1128,       1128,        1,   518400, 0x81e977b2
> > -1,  225640000,  225640000,  2127000,     2133, 0x670c11a5, F=0x0
> > +1,  225640000,  225640000,  2127000,     2133, 0x670c11a5
> > 0,       1139,       1139,        1,   518400, 0xbab197ea
> > -1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57, F=0x0
> > +1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57
> > 0,       1140,       1140,        1,   518400, 0xb046dd30
> > 0,       1145,       1145,        1,   518400, 0xbab197ea
> > -- 
> > 2.9.5
> > 
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > 
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Marton Balint May 6, 2020, 5:12 p.m. UTC | #4
On Wed, 6 May 2020, lance.lmwang@gmail.com wrote:

> On Wed, May 06, 2020 at 10:11:22AM +0200, Marton Balint wrote:
>> 
>> 
>> On Tue, 21 Apr 2020, lance.lmwang@gmail.com wrote:
>> 
>> > From: Limin Wang <lance.lmwang@gmail.com>
>> > 
>> > The patch will make audio and subtitle packets be marked as AV_PKT_FLAG_KEY.
>> 
>> Why the subtitles? Is it possible that the patch description is outdated? I
>> don't see from the code how would this apply to subtitles, after all
>> is_intra_only only check for audio and video, no?
>
> No, is_intra_only() check for subtitle also. It'll return 0 for audio and video
> and not AV_CODEC_PROP_INTRA_ONLY, other will return 1(is_intra).

Ah, ok. Is there a practical benefit for setting the keyframe flag for 
subtitles? Or it just happens to work out this way?

Either way, fine by me.

Thanks,
Marton

>
>
>> 
>> Thanks,
>> Marton
>> 
>> > 
>> > For audio, it'll caused the audio sample to be sync sample.
>> > To verify ref/fate/movenc results:
>> > 1. Get the movenc test data
>> > [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_old && mv *.mp4 audio_old_
>> > 
>> > After applied the patch:
>> > [lmwang@vpn ffmpeg]$ make fate-movenc SAMPLES=../fate-suite
>> > [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_key && mv *.mp4 audio_key
>> > 
>> > 2. Get l-smash and build boxdumper
>> > https://github.com/l-smash/l-smash.git
>> > 
>> > 3. dump the box of crc change mp4 and diff -u
>> > [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_key/non-empty-moov-no-elst.mp4  > audio_key/non-empty-moov-no-elst.log
>> > [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_old/non-empty-moov-no-elst.mp4  > audio_old/non-empty-moov-no-elst.log
>> > [lmwang@vpn ffmpeg]$ diff -u audio_key/non-empty-moov-no-elst.log audio_old/non-empty-moov-no-elst.log
>> > -                default_sample_flags = 0x02000000
>> > -                    independent
>> > -                    sync sample
>> > +                default_sample_flags = 0x01010000
>> > +                    dependent
>> > +                    non-sync sample
>> > 
>> > 4. have checked the change of crc are caused by default_sample_flags
>> > non-empty-moov.mp4, non-empty-moov-elst.mp4,
>> > non-empty-moov-no-elst.mp4, empty-moov.mp4, delay-moov-content.mp4,
>> > empty-moov-second-frag.mp4, empty-moov-second-frag-discont.mp4,
>> > delay-moov-second-frag-discont.mp4, delay-moov-elst-second-frag.mp4
>> > etc
>> > 
>> > 5 For subtitle, it'll effect for tests/ref/fate/binsub-movtextenc and
>> > tests/ref/fate/sub2video, that's expecting result for the subtitle is
>> > marked as keyframe. Below is the checking result of binsub-movtextenc:
>> > 
>> > [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_key/binsub-movtextenc.mp4
>> > [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_old/binsub-movtextenc.mp4
>> > [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_key/binsub-movtextenc.mp4  > audio_key/binsub-movtextenc.log
>> > [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_old/binsub-movtextenc.mp4  > audio_old/binsub-movtextenc.log
>> > [lmwang@vpn ffmpeg]$ diff -u audio_key/binsub-movtextenc.log audio_old/binsub-movtextenc.log
>> > .... // the key difference is the flag for sync sample
>> > -                flags = 0x000701
>> > +                flags = 0x000301
>> >                     data-offset-present
>> >                     sample-duration-present
>> >                     sample-size-present
>> > -                    sample-flags-present
>> >                 sample_count = 6
>> > -                data_offset = 188
>> > +                data_offset = 164
>> >                 sample[0]
>> >                     sample_duration = 1570000
>> >                     sample_size = 21
>> > -                    sample_flags = 0x02000000
>> > -                        independent
>> > -                        sync sample
>> > -                        degradation_priority = 0
>> >                 sample[1]
>> >                     sample_duration = 510000
>> >                     sample_size = 2
>> > -                    sample_flags = 0x01010000
>> > -                        dependent
>> > -                        non-sync sample
>> > -                        degradation_priority = 0
>> >                 sample[2]
>> >                     sample_duration = 1690000
>> >                     sample_size = 9
>> > -                    sample_flags = 0x02000000
>> > -                        independent
>> > -                        sync sample
>> > -                        degradation_priority = 0
>> > 
>> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
>> > ---
>> > libavformat/internal.h           |  2 +
>> > libavformat/mux.c                |  7 +++-
>> > tests/ref/fate/binsub-movtextenc |  2 +-
>> > tests/ref/fate/movenc            | 50 +++++++++++------------
>> > tests/ref/fate/sub2video         | 86 ++++++++++++++++++++--------------------
>> > 5 files changed, 77 insertions(+), 70 deletions(-)
>> > 
>> > diff --git a/libavformat/internal.h b/libavformat/internal.h
>> > index 716e42c..c4fac5c 100644
>> > --- a/libavformat/internal.h
>> > +++ b/libavformat/internal.h
>> > @@ -189,6 +189,8 @@ struct AVStreamInternal {
>> >      */
>> >     int need_context_update;
>> > 
>> > +    int is_intra_only;
>> > +
>> >     FFFrac *priv_pts;
>> > };
>> > 
>> > diff --git a/libavformat/mux.c b/libavformat/mux.c
>> > index a6253f5..ea6524f 100644
>> > --- a/libavformat/mux.c
>> > +++ b/libavformat/mux.c
>> > @@ -357,6 +357,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
>> >         if (desc && desc->props & AV_CODEC_PROP_REORDER)
>> >             st->internal->reorder = 1;
>> > 
>> > +        st->internal->is_intra_only = ff_is_intra_only(par->codec_id);
>> > +
>> >         if (of->codec_tag) {
>> >             if (   par->codec_tag
>> >                 && par->codec_id == AV_CODEC_ID_RAWVIDEO
>> > @@ -773,6 +775,7 @@ static int check_packet(AVFormatContext *s, AVPacket *pkt)
>> > static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>> > {
>> >     int ret;
>> > +    AVStream *st = s->streams[pkt->stream_index];
>> > 
>> >     ret = check_packet(s, pkt);
>> >     if (ret < 0)
>> > @@ -781,7 +784,6 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>> > #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
>> >     /* sanitize the timestamps */
>> >     if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
>> > -        AVStream *st = s->streams[pkt->stream_index];
>> > 
>> >         /* when there is no reordering (so dts is equal to pts), but
>> >          * only one of them is set, set the other as well */
>> > @@ -818,6 +820,9 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
>> >         }
>> >     }
>> > #endif
>> > +    /* update flags */
>> > +    if (st->internal->is_intra_only)
>> > +        pkt->flags |= AV_PKT_FLAG_KEY;
>> > 
>> >     return 0;
>> > }
>> > diff --git a/tests/ref/fate/binsub-movtextenc b/tests/ref/fate/binsub-movtextenc
>> > index 78c05f4..a8f94b7 100644
>> > --- a/tests/ref/fate/binsub-movtextenc
>> > +++ b/tests/ref/fate/binsub-movtextenc
>> > @@ -1 +1 @@
>> > -35adf776cd73e808186ae7124445f4b8
>> > +fc6d07679ac1f718aa50de687924cd97
>> > diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
>> > index 637a347..fb39b98 100644
>> > --- a/tests/ref/fate/movenc
>> > +++ b/tests/ref/fate/movenc
>> > @@ -2,17 +2,17 @@ write_data len 36, time nopts, type header atom ftyp
>> > write_data len 2389, time nopts, type header atom -
>> > write_data len 788, time 1000000, type sync atom moof
>> > write_data len 110, time nopts, type trailer atom -
>> > -66cf48604f039aa9a51711786f5c8778 3323 non-empty-moov
>> > +5f401347fc3c771b819e2449d69d4861 3323 non-empty-moov
>> > write_data len 36, time nopts, type header atom ftyp
>> > write_data len 2721, time nopts, type header atom -
>> > write_data len 908, time 966667, type sync atom moof
>> > write_data len 110, time nopts, type trailer atom -
>> > -04b2e86f455af94f9258b8d66dbf71f5 3775 non-empty-moov-elst
>> > +4267feee527adf8cd4f7b36ac0fc0872 3775 non-empty-moov-elst
>> > write_data len 36, time nopts, type header atom ftyp
>> > write_data len 2629, time nopts, type header atom -
>> > write_data len 908, time 1000000, type sync atom moof
>> > write_data len 110, time nopts, type trailer atom -
>> > -e9f6fa032d6d8265d67aef5de81a48bf 3683 non-empty-moov-no-elst
>> > +44077b9ad45f3e16fafe4e5ada54e9b0 3683 non-empty-moov-no-elst
>> > write_data len 24, time nopts, type header atom ftyp
>> > write_data len 1171, time nopts, type header atom -
>> > write_data len 728, time 0, type sync atom moof
>> > @@ -20,35 +20,35 @@ write_data len 828, time nopts, type unknown atom -
>> > write_data len 728, time 999999, type sync atom moof
>> > write_data len 812, time nopts, type unknown atom -
>> > write_data len 148, time nopts, type trailer atom -
>> > -da105e0b2c19079519c6eed7d5a1151c 4439 ismv
>> > +92ce825ff40505ec8676191705adb7e7 4439 ismv
>> > write_data len 36, time nopts, type header atom ftyp
>> > write_data len 1123, time nopts, type header atom -
>> > write_data len 796, time 0, type sync atom moof
>> > write_data len 788, time 1000000, type sync atom moof
>> > write_data len 148, time nopts, type trailer atom -
>> > -e6a4b15443d006efd727a80f6624b7db 2891 empty-moov
>> > +08f4b3ad3a3ea224b2ee731476b9056b 2891 empty-moov
>> > write_data len 36, time nopts, type header atom ftyp
>> > write_data len 1123, time nopts, type header atom -
>> > write_data len 1068, time 0, type sync atom moof
>> > write_data len 908, time 1000000, type sync atom moof
>> > write_data len 148, time nopts, type trailer atom -
>> > -800f854aff2ac76dfaddebd0562c75b9 3283 empty-moov-no-elst
>> > +d7a2dcb43eb0f95f92669f55fc7adeba 3283 empty-moov-no-elst
>> > write_data len 36, time nopts, type header atom ftyp
>> > write_data len 1123, time nopts, type header atom -
>> > write_data len 900, time -33333, type sync atom moof
>> > write_data len 908, time 966667, type sync atom moof
>> > write_data len 148, time nopts, type trailer atom -
>> > -eca1a945c9063dab0858af6b85925533 3115 empty-moov-no-elst-no-adjust
>> > +ea70ca697306976879be408431c27aee 3115 empty-moov-no-elst-no-adjust
>> > write_data len 1159, time nopts, type header atom ftyp
>> > write_data len 796, time 0, type sync atom moof
>> > write_data len 788, time 1000000, type sync atom moof
>> > write_data len 148, time nopts, type trailer atom -
>> > -e6a4b15443d006efd727a80f6624b7db 2891 delay-moov
>> > +08f4b3ad3a3ea224b2ee731476b9056b 2891 delay-moov
>> > write_data len 1231, time nopts, type header atom ftyp
>> > write_data len 916, time -33333, type sync atom moof
>> > write_data len 908, time 966667, type sync atom moof
>> > write_data len 148, time nopts, type trailer atom -
>> > -c2ecdbc80668fcee73f5a039e2dba579 3203 delay-moov-elst
>> > +314cc3b6296f4ee583b328a34be50b2f 3203 delay-moov-elst
>> > write_data len 1195, time nopts, type header atom ftyp
>> > write_data len 836, time 0, type sync atom moof
>> > write_data len 67, time nopts, type trailer atom -
>> > @@ -63,66 +63,66 @@ write_data len 1123, time nopts, type header atom -
>> > 351ae2c8b6d35d98b4848c309cce6704 1159 empty-moov-header
>> > write_data len 796, time 0, type sync atom moof
>> > write_data len 788, time 1000000, type sync atom moof
>> > -a0165f4a26a409212b0946e981bdefb9 1584 empty-moov-content
>> > +289ee982188d66988a374a462b0b5376 1584 empty-moov-content
>> > write_data len 148, time nopts, type trailer atom -
>> > write_data len 1159, time nopts, type header atom ftyp
>> > 351ae2c8b6d35d98b4848c309cce6704 1159 delay-moov-header
>> > write_data len 796, time 0, type sync atom moof
>> > write_data len 788, time 1000000, type sync atom moof
>> > -a0165f4a26a409212b0946e981bdefb9 1584 delay-moov-content
>> > +289ee982188d66988a374a462b0b5376 1584 delay-moov-content
>> > write_data len 148, time nopts, type trailer atom -
>> > write_data len 28, time nopts, type header atom -
>> > write_data len 1123, time nopts, type header atom -
>> > write_data len 884, time 0, type sync atom sidx
>> > write_data len 876, time 1000000, type sync atom sidx
>> > -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag
>> > +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag
>> > write_data len 148, time nopts, type trailer atom -
>> > write_data len 28, time nopts, type header atom -
>> > write_data len 1123, time nopts, type header atom -
>> > write_data len 876, time 1000000, type sync atom sidx
>> > -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag-discont
>> > +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag-discont
>> > write_data len 110, time nopts, type trailer atom -
>> > write_data len 1223, time nopts, type header atom -
>> > write_data len 876, time 1000000, type sync atom sidx
>> > -272a474cfd2a68cc5f05b426b14a2b7d 876 delay-moov-second-frag-discont
>> > +c0307f99a2a362205b7e3d65b1066f86 876 delay-moov-second-frag-discont
>> > write_data len 110, time nopts, type trailer atom -
>> > write_data len 1223, time nopts, type header atom ftyp
>> > b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init
>> > write_data len 988, time -33333, type sync atom sidx
>> > write_data len 996, time 966667, type sync atom sidx
>> > -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag
>> > +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag
>> > write_data len 148, time nopts, type trailer atom -
>> > write_data len 1223, time nopts, type header atom ftyp
>> > b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init-discont
>> > write_data len 996, time 966667, type sync atom sidx
>> > -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag-discont
>> > +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag-discont
>> > write_data len 110, time nopts, type trailer atom -
>> > write_data len 1223, time nopts, type header atom ftyp
>> > 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init
>> > write_data len 1004, time -33333, type sync atom sidx
>> > write_data len 996, time 966667, type sync atom sidx
>> > -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag
>> > +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag
>> > write_data len 148, time nopts, type trailer atom -
>> > write_data len 1223, time nopts, type header atom ftyp
>> > 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init-discont
>> > write_data len 996, time 966667, type sync atom sidx
>> > -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag-discont
>> > +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag-discont
>> > write_data len 110, time nopts, type trailer atom -
>> > write_data len 1247, time nopts, type header atom ftyp
>> > 80511a51d1ac9cde62337eed7176ae03 1247 delay-moov-elst-signal-init-discont-largets
>> > write_data len 996, time 279621233333, type sync atom sidx
>> > -41cac4c3df656a87bb38363fdcd745e6 996 delay-moov-elst-signal-second-frag-discont-largets
>> > +dc695d65e8a0cdafee28acd8a5ccf81a 996 delay-moov-elst-signal-second-frag-discont-largets
>> > write_data len 110, time nopts, type trailer atom -
>> > write_data len 1223, time nopts, type header atom ftyp
>> > write_data len 2572, time -333333, type sync atom sidx
>> > write_data len 996, time 5166667, type sync atom sidx
>> > write_data len 148, time nopts, type trailer atom -
>> > -c3eb39921c90724784d1ab84fac58b34 4939 vfr
>> > +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr
>> > write_data len 1223, time nopts, type header atom ftyp
>> > write_data len 2572, time -333333, type sync atom sidx
>> > write_data len 996, time 5166667, type sync atom sidx
>> > write_data len 148, time nopts, type trailer atom -
>> > -c3eb39921c90724784d1ab84fac58b34 4939 vfr-noduration
>> > +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr-noduration
>> > write_data len 1231, time nopts, type header atom ftyp
>> > write_data len 1500, time -333333, type sync atom moof
>> > write_data len 1500, time nopts, type unknown atom -
>> > @@ -131,7 +131,7 @@ write_data len 1500, time 9666667, type sync atom moof
>> > write_data len 1500, time nopts, type unknown atom -
>> > write_data len 1004, time nopts, type unknown atom -
>> > write_data len 148, time nopts, type trailer atom -
>> > -5bde1358e246e715b2096daa321c9f1b 9299 large_frag
>> > +08b6401dc81912e5264245b7233c4ab3 9299 large_frag
>> > write_data len 1231, time nopts, type header atom ftyp
>> > write_data len 684, time -33333, type sync atom moof
>> > write_data len 504, time 800000, type boundary atom moof
>> > @@ -139,15 +139,15 @@ write_data len 420, time 1266667, type boundary atom moof
>> > write_data len 668, time 1566667, type sync atom moof
>> > write_data len 440, time 2233333, type boundary atom moof
>> > write_data len 262, time nopts, type trailer atom -
>> > -47cc2460c4b18390c67991cf3251409b 4209 vfr-noduration-interleave
>> > +a5d087611a9229ba91eb0964cf2f17d9 4209 vfr-noduration-interleave
>> > write_data len 1231, time nopts, type header atom ftyp
>> > write_data len 916, time 0, type sync atom moof
>> > write_data len 908, time 1000000, type sync atom moof
>> > write_data len 148, time nopts, type trailer atom -
>> > -c200a345c365dd35a31e7e62a9ae6c10 3203 delay-moov-elst-neg-cts
>> > +d81c3a0ce5940a2db74c99ad435e0560 3203 delay-moov-elst-neg-cts
>> > write_data len 36, time nopts, type header atom ftyp
>> > write_data len 1123, time nopts, type header atom -
>> > write_data len 900, time 0, type sync atom moof
>> > write_data len 908, time 1000000, type sync atom moof
>> > write_data len 148, time nopts, type trailer atom -
>> > -868bb53d861d81b1c15ef4d59afc83b5 3115 empty-moov-neg-cts
>> > +3be575022e446855bca1e45b7942cc0c 3115 empty-moov-neg-cts
>> > diff --git a/tests/ref/fate/sub2video b/tests/ref/fate/sub2video
>> > index 4e034a5..80abe9c 100644
>> > --- a/tests/ref/fate/sub2video
>> > +++ b/tests/ref/fate/sub2video
>> > @@ -10,7 +10,7 @@
>> > 0,          0,          0,        1,   518400, 0x83c27b82
>> > 0,          1,          1,        1,   518400, 0x4051c7f9
>> > 0,          2,          2,        1,   518400, 0xfb00e17e
>> > -1,     499000,     499000,  4960000,     1015, 0x19e092d2, F=0x0
>> > +1,     499000,     499000,  4960000,     1015, 0x19e092d2
>> > 0,          3,          3,        1,   518400, 0x192abb74
>> > 0,          4,          4,        1,   518400, 0x4669a88b
>> > 0,          5,          5,        1,   518400, 0xaababe00
>> > @@ -58,129 +58,129 @@
>> > 0,         47,         47,        1,   518400, 0xde69683f
>> > 0,         48,         48,        1,   518400, 0x7df08fba
>> > 0,         49,         49,        1,   518400, 0xbab197ea
>> > -1,   15355000,   15355000,  4733000,     2094, 0x3c171425, F=0x0
>> > +1,   15355000,   15355000,  4733000,     2094, 0x3c171425
>> > 0,         77,         77,        1,   518400, 0x902285d9
>> > 0,        100,        100,        1,   518400, 0xbab197ea
>> > -1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21, F=0x0
>> > +1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21
>> > 0,        244,        244,        1,   518400, 0x7a11c812
>> > 0,        257,        257,        1,   518400, 0xbab197ea
>> > -1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05, F=0x0
>> > +1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05
>> > 0,        258,        258,        1,   518400, 0x34cdddee
>> > 0,        269,        269,        1,   518400, 0xbab197ea
>> > -1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed, F=0x0
>> > +1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed
>> > 0,        270,        270,        1,   518400, 0x4db4ce51
>> > 0,        283,        283,        1,   518400, 0xbab197ea
>> > -1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7, F=0x0
>> > +1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7
>> > 0,        284,        284,        1,   518400, 0xe6bc0ea9
>> > 0,        290,        290,        1,   518400, 0xbab197ea
>> > -1,   58014000,   58014000,  1661000,      969, 0xe01878f0, F=0x0
>> > +1,   58014000,   58014000,  1661000,      969, 0xe01878f0
>> > 0,        291,        291,        1,   518400, 0xa8643af7
>> > 0,        298,        298,        1,   518400, 0xbab197ea
>> > -1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1, F=0x0
>> > +1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1
>> > 0,        339,        339,        1,   518400, 0xb1885c67
>> > 0,        345,        345,        1,   518400, 0xbab197ea
>> > -1,   69175000,   69175000,  1558000,      802, 0xf48531ba, F=0x0
>> > +1,   69175000,   69175000,  1558000,      802, 0xf48531ba
>> > 0,        346,        346,        1,   518400, 0x378e3fd0
>> > 0,        354,        354,        1,   518400, 0xbab197ea
>> > -1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd, F=0x0
>> > +1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd
>> > 0,        355,        355,        1,   518400, 0xa3782469
>> > 0,        363,        363,        1,   518400, 0xbab197ea
>> > -1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82, F=0x0
>> > +1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82
>> > 0,        364,        364,        1,   518400, 0xba23a0d5
>> > 0,        374,        374,        1,   518400, 0xbab197ea
>> > -1,   74806000,   74806000,  1831000,     2116, 0x96514097, F=0x0
>> > +1,   74806000,   74806000,  1831000,     2116, 0x96514097
>> > 0,        375,        375,        1,   518400, 0x129de2f8
>> > 0,        383,        383,        1,   518400, 0xbab197ea
>> > -1,   76716000,   76716000,  1262000,     1822, 0xefccc72e, F=0x0
>> > +1,   76716000,   76716000,  1262000,     1822, 0xefccc72e
>> > 0,        384,        384,        1,   518400, 0x19772f0f
>> > 0,        390,        390,        1,   518400, 0xbab197ea
>> > -1,   78051000,   78051000,  1524000,      987, 0x7b927a27, F=0x0
>> > +1,   78051000,   78051000,  1524000,      987, 0x7b927a27
>> > 0,        391,        391,        1,   518400, 0x56f54e73
>> > 0,        398,        398,        1,   518400, 0xbab197ea
>> > -1,   79644000,   79644000,  2662000,     2956, 0x190778f7, F=0x0
>> > +1,   79644000,   79644000,  2662000,     2956, 0x190778f7
>> > 0,        399,        399,        1,   518400, 0x300b5247
>> > -1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3, F=0x0
>> > +1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3
>> > 0,        412,        412,        1,   518400, 0xbab197ea
>> > 0,        413,        413,        1,   518400, 0x6fd028fa
>> > 0,        426,        426,        1,   518400, 0xbab197ea
>> > -1,   85225000,   85225000,  2366000,     2585, 0x74d0048f, F=0x0
>> > +1,   85225000,   85225000,  2366000,     2585, 0x74d0048f
>> > 0,        427,        427,        1,   518400, 0x01f80e9d
>> > 0,        438,        438,        1,   518400, 0xbab197ea
>> > -1,   87652000,   87652000,  1831000,      634, 0x8832fda1, F=0x0
>> > +1,   87652000,   87652000,  1831000,      634, 0x8832fda1
>> > 0,        439,        439,        1,   518400, 0xb48d90c0
>> > 0,        447,        447,        1,   518400, 0xbab197ea
>> > -1,   91531000,   91531000,  2332000,     2080, 0x97a1146f, F=0x0
>> > +1,   91531000,   91531000,  2332000,     2080, 0x97a1146f
>> > 0,        458,        458,        1,   518400, 0xcb5a0173
>> > 0,        469,        469,        1,   518400, 0xbab197ea
>> > -1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684, F=0x0
>> > +1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684
>> > 0,        478,        478,        1,   518400, 0xb8a323e4
>> > 0,        494,        494,        1,   518400, 0xbab197ea
>> > -1,   98872000,   98872000,  2161000,     1875, 0x9002ef71, F=0x0
>> > +1,   98872000,   98872000,  2161000,     1875, 0x9002ef71
>> > 0,        495,        495,        1,   518400, 0xc43518ba
>> > 0,        505,        505,        1,   518400, 0xbab197ea
>> > -1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c, F=0x0
>> > +1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c
>> > 0,        506,        506,        1,   518400, 0x04e38692
>> > 0,        526,        526,        1,   518400, 0xbab197ea
>> > -1,  105303000,  105303000,  2730000,     3094, 0xf203a663, F=0x0
>> > +1,  105303000,  105303000,  2730000,     3094, 0xf203a663
>> > 0,        527,        527,        1,   518400, 0x856b0ee5
>> > 0,        540,        540,        1,   518400, 0xbab197ea
>> > -1,  108106000,  108106000,  2059000,     2404, 0x41a7b429, F=0x0
>> > +1,  108106000,  108106000,  2059000,     2404, 0x41a7b429
>> > 0,        541,        541,        1,   518400, 0x3e5beee2
>> > 0,        551,        551,        1,   518400, 0xbab197ea
>> > -1,  141556000,  141556000,  1661000,     1088, 0xde20aa20, F=0x0
>> > +1,  141556000,  141556000,  1661000,     1088, 0xde20aa20
>> > 0,        708,        708,        1,   518400, 0xb8bc1365
>> > 0,        716,        716,        1,   518400, 0xbab197ea
>> > 0,        817,        817,        1,   518400, 0x83efa32d
>> > -1,  163445000,  163445000,  1331000,      339, 0x8bd186ef, F=0x0
>> > +1,  163445000,  163445000,  1331000,      339, 0x8bd186ef
>> > 0,        824,        824,        1,   518400, 0xbab197ea
>> > 0,        840,        840,        1,   518400, 0x03ea0e90
>> > -1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d, F=0x0
>> > +1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d
>> > 0,        850,        850,        1,   518400, 0xbab197ea
>> > -1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe, F=0x0
>> > +1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe
>> > 0,        851,        851,        1,   518400, 0x8780239e
>> > 0,        858,        858,        1,   518400, 0xbab197ea
>> > 0,        861,        861,        1,   518400, 0x6eb72347
>> > -1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769, F=0x0
>> > +1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769
>> > 0,        869,        869,        1,   518400, 0xbab197ea
>> > -1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc, F=0x0
>> > +1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc
>> > 0,        870,        870,        1,   518400, 0x9c4a3a3d
>> > 0,        879,        879,        1,   518400, 0xbab197ea
>> > -1,  175957000,  175957000,  1763000,     1019, 0x20409355, F=0x0
>> > +1,  175957000,  175957000,  1763000,     1019, 0x20409355
>> > 0,        880,        880,        1,   518400, 0xc9ebfa89
>> > 0,        889,        889,        1,   518400, 0xbab197ea
>> > 0,        946,        946,        1,   518400, 0xbaf801ef
>> > -1,  189295000,  189295000,  1968000,     1596, 0x408c726e, F=0x0
>> > +1,  189295000,  189295000,  1968000,     1596, 0x408c726e
>> > 0,        956,        956,        1,   518400, 0xbab197ea
>> > -1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b, F=0x0
>> > +1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b
>> > 0,        957,        957,        1,   518400, 0x59f4e72f
>> > 0,        963,        963,        1,   518400, 0xbab197ea
>> > -1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4, F=0x0
>> > +1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4
>> > 0,        964,        964,        1,   518400, 0x9d5b9d69
>> > 0,        972,        972,        1,   518400, 0xbab197ea
>> > -1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8, F=0x0
>> > +1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8
>> > 0,        976,        976,        1,   518400, 0x923d1ce7
>> > 0,        981,        981,        1,   518400, 0xbab197ea
>> > -1,  196361000,  196361000,  1524000,     1715, 0x695ca41e, F=0x0
>> > +1,  196361000,  196361000,  1524000,     1715, 0x695ca41e
>> > 0,        982,        982,        1,   518400, 0x6e652cd2
>> > 0,        989,        989,        1,   518400, 0xbab197ea
>> > -1,  197946000,  197946000,  1160000,      789, 0xc63a189e, F=0x0
>> > +1,  197946000,  197946000,  1160000,      789, 0xc63a189e
>> > 0,        990,        990,        1,   518400, 0x25113966
>> > 0,        996,        996,        1,   518400, 0xbab197ea
>> > -1,  199230000,  199230000,  1627000,     1846, 0xeea8c599, F=0x0
>> > +1,  199230000,  199230000,  1627000,     1846, 0xeea8c599
>> > 0,        997,        997,        1,   518400, 0x2dc83609
>> > 0,       1004,       1004,        1,   518400, 0xbab197ea
>> > -1,  200924000,  200924000,  1763000,      922, 0xd4a87222, F=0x0
>> > +1,  200924000,  200924000,  1763000,      922, 0xd4a87222
>> > 0,       1005,       1005,        1,   518400, 0x90483bc6
>> > 0,       1013,       1013,        1,   518400, 0xbab197ea
>> > 0,       1053,       1053,        1,   518400, 0x3de86ab7
>> > -1,  210600000,  210600000,  1831000,      665, 0x55580135, F=0x0
>> > +1,  210600000,  210600000,  1831000,      665, 0x55580135
>> > 0,       1062,       1062,        1,   518400, 0xbab197ea
>> > -1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5, F=0x0
>> > +1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5
>> > 0,       1074,       1074,        1,   518400, 0x8c320e68
>> > 0,       1082,       1082,        1,   518400, 0xbab197ea
>> > 0,       1128,       1128,        1,   518400, 0x81e977b2
>> > -1,  225640000,  225640000,  2127000,     2133, 0x670c11a5, F=0x0
>> > +1,  225640000,  225640000,  2127000,     2133, 0x670c11a5
>> > 0,       1139,       1139,        1,   518400, 0xbab197ea
>> > -1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57, F=0x0
>> > +1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57
>> > 0,       1140,       1140,        1,   518400, 0xb046dd30
>> > 0,       1145,       1145,        1,   518400, 0xbab197ea
>> > -- 
>> > 2.9.5
>> > 
>> > _______________________________________________
>> > ffmpeg-devel mailing list
>> > ffmpeg-devel@ffmpeg.org
>> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> > 
>> > To unsubscribe, visit link above, or email
>> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>> _______________________________________________
>> ffmpeg-devel mailing list
>> ffmpeg-devel@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>> 
>> To unsubscribe, visit link above, or email
>> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
>
> -- 
> Thanks,
> Limin Wang
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Lance Wang May 6, 2020, 11:09 p.m. UTC | #5
On Wed, May 06, 2020 at 07:12:23PM +0200, Marton Balint wrote:
> 
> 
> On Wed, 6 May 2020, lance.lmwang@gmail.com wrote:
> 
> > On Wed, May 06, 2020 at 10:11:22AM +0200, Marton Balint wrote:
> > > 
> > > 
> > > On Tue, 21 Apr 2020, lance.lmwang@gmail.com wrote:
> > > 
> > > > From: Limin Wang <lance.lmwang@gmail.com>
> > > > > The patch will make audio and subtitle packets be marked as
> > > AV_PKT_FLAG_KEY.
> > > 
> > > Why the subtitles? Is it possible that the patch description is outdated? I
> > > don't see from the code how would this apply to subtitles, after all
> > > is_intra_only only check for audio and video, no?
> > 
> > No, is_intra_only() check for subtitle also. It'll return 0 for audio and video
> > and not AV_CODEC_PROP_INTRA_ONLY, other will return 1(is_intra).
> 
> Ah, ok. Is there a practical benefit for setting the keyframe flag for
> subtitles? Or it just happens to work out this way?

yes, hls webvtt subtitle need split by segment by the keyframe flag.

> 
> Either way, fine by me.
> 
> Thanks,
> Marton
> 
> > 
> > 
> > > 
> > > Thanks,
> > > Marton
> > > 
> > > > > For audio, it'll caused the audio sample to be sync sample.
> > > > To verify ref/fate/movenc results:
> > > > 1. Get the movenc test data
> > > > [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_old && mv *.mp4 audio_old_
> > > > > After applied the patch:
> > > > [lmwang@vpn ffmpeg]$ make fate-movenc SAMPLES=../fate-suite
> > > > [lmwang@vpn ffmpeg]$ libavformat/tests/movenc -w && mkdir -p audio_key && mv *.mp4 audio_key
> > > > > 2. Get l-smash and build boxdumper
> > > > https://github.com/l-smash/l-smash.git
> > > > > 3. dump the box of crc change mp4 and diff -u
> > > > [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_key/non-empty-moov-no-elst.mp4  > audio_key/non-empty-moov-no-elst.log
> > > > [lmwang@vpn ffmpeg]$ ../l-smash/cli/boxdumper --box audio_old/non-empty-moov-no-elst.mp4  > audio_old/non-empty-moov-no-elst.log
> > > > [lmwang@vpn ffmpeg]$ diff -u audio_key/non-empty-moov-no-elst.log audio_old/non-empty-moov-no-elst.log
> > > > -                default_sample_flags = 0x02000000
> > > > -                    independent
> > > > -                    sync sample
> > > > +                default_sample_flags = 0x01010000
> > > > +                    dependent
> > > > +                    non-sync sample
> > > > > 4. have checked the change of crc are caused by
> > > default_sample_flags
> > > > non-empty-moov.mp4, non-empty-moov-elst.mp4,
> > > > non-empty-moov-no-elst.mp4, empty-moov.mp4, delay-moov-content.mp4,
> > > > empty-moov-second-frag.mp4, empty-moov-second-frag-discont.mp4,
> > > > delay-moov-second-frag-discont.mp4, delay-moov-elst-second-frag.mp4
> > > > etc
> > > > > 5 For subtitle, it'll effect for
> > > tests/ref/fate/binsub-movtextenc and
> > > > tests/ref/fate/sub2video, that's expecting result for the subtitle is
> > > > marked as keyframe. Below is the checking result of binsub-movtextenc:
> > > > > [lmwang@vpn ffmpeg]$ ./ffmpeg -i
> > > ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec
> > > mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags
> > > frag_keyframe+empty_moov audio_key/binsub-movtextenc.mp4
> > > > [lmwang@vpn ffmpeg]$ ./ffmpeg -i ../fate-suite/sub/MovText_capability_tester.mp4 -map 0 -scodec mov_text -f mp4 -flags +bitexact -fflags +bitexact -movflags frag_keyframe+empty_moov audio_old/binsub-movtextenc.mp4
> > > > [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_key/binsub-movtextenc.mp4  > audio_key/binsub-movtextenc.log
> > > > [lmwang@vpn ffmpeg]$../l-smash/cli/boxdumper audio_old/binsub-movtextenc.mp4  > audio_old/binsub-movtextenc.log
> > > > [lmwang@vpn ffmpeg]$ diff -u audio_key/binsub-movtextenc.log audio_old/binsub-movtextenc.log
> > > > .... // the key difference is the flag for sync sample
> > > > -                flags = 0x000701
> > > > +                flags = 0x000301
> > > >                     data-offset-present
> > > >                     sample-duration-present
> > > >                     sample-size-present
> > > > -                    sample-flags-present
> > > >                 sample_count = 6
> > > > -                data_offset = 188
> > > > +                data_offset = 164
> > > >                 sample[0]
> > > >                     sample_duration = 1570000
> > > >                     sample_size = 21
> > > > -                    sample_flags = 0x02000000
> > > > -                        independent
> > > > -                        sync sample
> > > > -                        degradation_priority = 0
> > > >                 sample[1]
> > > >                     sample_duration = 510000
> > > >                     sample_size = 2
> > > > -                    sample_flags = 0x01010000
> > > > -                        dependent
> > > > -                        non-sync sample
> > > > -                        degradation_priority = 0
> > > >                 sample[2]
> > > >                     sample_duration = 1690000
> > > >                     sample_size = 9
> > > > -                    sample_flags = 0x02000000
> > > > -                        independent
> > > > -                        sync sample
> > > > -                        degradation_priority = 0
> > > > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > > > ---
> > > > libavformat/internal.h           |  2 +
> > > > libavformat/mux.c                |  7 +++-
> > > > tests/ref/fate/binsub-movtextenc |  2 +-
> > > > tests/ref/fate/movenc            | 50 +++++++++++------------
> > > > tests/ref/fate/sub2video         | 86 ++++++++++++++++++++--------------------
> > > > 5 files changed, 77 insertions(+), 70 deletions(-)
> > > > > diff --git a/libavformat/internal.h b/libavformat/internal.h
> > > > index 716e42c..c4fac5c 100644
> > > > --- a/libavformat/internal.h
> > > > +++ b/libavformat/internal.h
> > > > @@ -189,6 +189,8 @@ struct AVStreamInternal {
> > > >      */
> > > >     int need_context_update;
> > > > > +    int is_intra_only;
> > > > +
> > > >     FFFrac *priv_pts;
> > > > };
> > > > > diff --git a/libavformat/mux.c b/libavformat/mux.c
> > > > index a6253f5..ea6524f 100644
> > > > --- a/libavformat/mux.c
> > > > +++ b/libavformat/mux.c
> > > > @@ -357,6 +357,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
> > > >         if (desc && desc->props & AV_CODEC_PROP_REORDER)
> > > >             st->internal->reorder = 1;
> > > > > +        st->internal->is_intra_only =
> > > ff_is_intra_only(par->codec_id);
> > > > +
> > > >         if (of->codec_tag) {
> > > >             if (   par->codec_tag
> > > >                 && par->codec_id == AV_CODEC_ID_RAWVIDEO
> > > > @@ -773,6 +775,7 @@ static int check_packet(AVFormatContext *s, AVPacket *pkt)
> > > > static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
> > > > {
> > > >     int ret;
> > > > +    AVStream *st = s->streams[pkt->stream_index];
> > > > >     ret = check_packet(s, pkt);
> > > >     if (ret < 0)
> > > > @@ -781,7 +784,6 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
> > > > #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
> > > >     /* sanitize the timestamps */
> > > >     if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
> > > > -        AVStream *st = s->streams[pkt->stream_index];
> > > > >         /* when there is no reordering (so dts is equal to pts),
> > > but
> > > >          * only one of them is set, set the other as well */
> > > > @@ -818,6 +820,9 @@ static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
> > > >         }
> > > >     }
> > > > #endif
> > > > +    /* update flags */
> > > > +    if (st->internal->is_intra_only)
> > > > +        pkt->flags |= AV_PKT_FLAG_KEY;
> > > > >     return 0;
> > > > }
> > > > diff --git a/tests/ref/fate/binsub-movtextenc b/tests/ref/fate/binsub-movtextenc
> > > > index 78c05f4..a8f94b7 100644
> > > > --- a/tests/ref/fate/binsub-movtextenc
> > > > +++ b/tests/ref/fate/binsub-movtextenc
> > > > @@ -1 +1 @@
> > > > -35adf776cd73e808186ae7124445f4b8
> > > > +fc6d07679ac1f718aa50de687924cd97
> > > > diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
> > > > index 637a347..fb39b98 100644
> > > > --- a/tests/ref/fate/movenc
> > > > +++ b/tests/ref/fate/movenc
> > > > @@ -2,17 +2,17 @@ write_data len 36, time nopts, type header atom ftyp
> > > > write_data len 2389, time nopts, type header atom -
> > > > write_data len 788, time 1000000, type sync atom moof
> > > > write_data len 110, time nopts, type trailer atom -
> > > > -66cf48604f039aa9a51711786f5c8778 3323 non-empty-moov
> > > > +5f401347fc3c771b819e2449d69d4861 3323 non-empty-moov
> > > > write_data len 36, time nopts, type header atom ftyp
> > > > write_data len 2721, time nopts, type header atom -
> > > > write_data len 908, time 966667, type sync atom moof
> > > > write_data len 110, time nopts, type trailer atom -
> > > > -04b2e86f455af94f9258b8d66dbf71f5 3775 non-empty-moov-elst
> > > > +4267feee527adf8cd4f7b36ac0fc0872 3775 non-empty-moov-elst
> > > > write_data len 36, time nopts, type header atom ftyp
> > > > write_data len 2629, time nopts, type header atom -
> > > > write_data len 908, time 1000000, type sync atom moof
> > > > write_data len 110, time nopts, type trailer atom -
> > > > -e9f6fa032d6d8265d67aef5de81a48bf 3683 non-empty-moov-no-elst
> > > > +44077b9ad45f3e16fafe4e5ada54e9b0 3683 non-empty-moov-no-elst
> > > > write_data len 24, time nopts, type header atom ftyp
> > > > write_data len 1171, time nopts, type header atom -
> > > > write_data len 728, time 0, type sync atom moof
> > > > @@ -20,35 +20,35 @@ write_data len 828, time nopts, type unknown atom -
> > > > write_data len 728, time 999999, type sync atom moof
> > > > write_data len 812, time nopts, type unknown atom -
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -da105e0b2c19079519c6eed7d5a1151c 4439 ismv
> > > > +92ce825ff40505ec8676191705adb7e7 4439 ismv
> > > > write_data len 36, time nopts, type header atom ftyp
> > > > write_data len 1123, time nopts, type header atom -
> > > > write_data len 796, time 0, type sync atom moof
> > > > write_data len 788, time 1000000, type sync atom moof
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -e6a4b15443d006efd727a80f6624b7db 2891 empty-moov
> > > > +08f4b3ad3a3ea224b2ee731476b9056b 2891 empty-moov
> > > > write_data len 36, time nopts, type header atom ftyp
> > > > write_data len 1123, time nopts, type header atom -
> > > > write_data len 1068, time 0, type sync atom moof
> > > > write_data len 908, time 1000000, type sync atom moof
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -800f854aff2ac76dfaddebd0562c75b9 3283 empty-moov-no-elst
> > > > +d7a2dcb43eb0f95f92669f55fc7adeba 3283 empty-moov-no-elst
> > > > write_data len 36, time nopts, type header atom ftyp
> > > > write_data len 1123, time nopts, type header atom -
> > > > write_data len 900, time -33333, type sync atom moof
> > > > write_data len 908, time 966667, type sync atom moof
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -eca1a945c9063dab0858af6b85925533 3115 empty-moov-no-elst-no-adjust
> > > > +ea70ca697306976879be408431c27aee 3115 empty-moov-no-elst-no-adjust
> > > > write_data len 1159, time nopts, type header atom ftyp
> > > > write_data len 796, time 0, type sync atom moof
> > > > write_data len 788, time 1000000, type sync atom moof
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -e6a4b15443d006efd727a80f6624b7db 2891 delay-moov
> > > > +08f4b3ad3a3ea224b2ee731476b9056b 2891 delay-moov
> > > > write_data len 1231, time nopts, type header atom ftyp
> > > > write_data len 916, time -33333, type sync atom moof
> > > > write_data len 908, time 966667, type sync atom moof
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -c2ecdbc80668fcee73f5a039e2dba579 3203 delay-moov-elst
> > > > +314cc3b6296f4ee583b328a34be50b2f 3203 delay-moov-elst
> > > > write_data len 1195, time nopts, type header atom ftyp
> > > > write_data len 836, time 0, type sync atom moof
> > > > write_data len 67, time nopts, type trailer atom -
> > > > @@ -63,66 +63,66 @@ write_data len 1123, time nopts, type header atom -
> > > > 351ae2c8b6d35d98b4848c309cce6704 1159 empty-moov-header
> > > > write_data len 796, time 0, type sync atom moof
> > > > write_data len 788, time 1000000, type sync atom moof
> > > > -a0165f4a26a409212b0946e981bdefb9 1584 empty-moov-content
> > > > +289ee982188d66988a374a462b0b5376 1584 empty-moov-content
> > > > write_data len 148, time nopts, type trailer atom -
> > > > write_data len 1159, time nopts, type header atom ftyp
> > > > 351ae2c8b6d35d98b4848c309cce6704 1159 delay-moov-header
> > > > write_data len 796, time 0, type sync atom moof
> > > > write_data len 788, time 1000000, type sync atom moof
> > > > -a0165f4a26a409212b0946e981bdefb9 1584 delay-moov-content
> > > > +289ee982188d66988a374a462b0b5376 1584 delay-moov-content
> > > > write_data len 148, time nopts, type trailer atom -
> > > > write_data len 28, time nopts, type header atom -
> > > > write_data len 1123, time nopts, type header atom -
> > > > write_data len 884, time 0, type sync atom sidx
> > > > write_data len 876, time 1000000, type sync atom sidx
> > > > -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag
> > > > +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag
> > > > write_data len 148, time nopts, type trailer atom -
> > > > write_data len 28, time nopts, type header atom -
> > > > write_data len 1123, time nopts, type header atom -
> > > > write_data len 876, time 1000000, type sync atom sidx
> > > > -272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag-discont
> > > > +c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag-discont
> > > > write_data len 110, time nopts, type trailer atom -
> > > > write_data len 1223, time nopts, type header atom -
> > > > write_data len 876, time 1000000, type sync atom sidx
> > > > -272a474cfd2a68cc5f05b426b14a2b7d 876 delay-moov-second-frag-discont
> > > > +c0307f99a2a362205b7e3d65b1066f86 876 delay-moov-second-frag-discont
> > > > write_data len 110, time nopts, type trailer atom -
> > > > write_data len 1223, time nopts, type header atom ftyp
> > > > b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init
> > > > write_data len 988, time -33333, type sync atom sidx
> > > > write_data len 996, time 966667, type sync atom sidx
> > > > -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag
> > > > +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag
> > > > write_data len 148, time nopts, type trailer atom -
> > > > write_data len 1223, time nopts, type header atom ftyp
> > > > b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init-discont
> > > > write_data len 996, time 966667, type sync atom sidx
> > > > -fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag-discont
> > > > +0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag-discont
> > > > write_data len 110, time nopts, type trailer atom -
> > > > write_data len 1223, time nopts, type header atom ftyp
> > > > 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init
> > > > write_data len 1004, time -33333, type sync atom sidx
> > > > write_data len 996, time 966667, type sync atom sidx
> > > > -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag
> > > > +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag
> > > > write_data len 148, time nopts, type trailer atom -
> > > > write_data len 1223, time nopts, type header atom ftyp
> > > > 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init-discont
> > > > write_data len 996, time 966667, type sync atom sidx
> > > > -aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag-discont
> > > > +5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag-discont
> > > > write_data len 110, time nopts, type trailer atom -
> > > > write_data len 1247, time nopts, type header atom ftyp
> > > > 80511a51d1ac9cde62337eed7176ae03 1247 delay-moov-elst-signal-init-discont-largets
> > > > write_data len 996, time 279621233333, type sync atom sidx
> > > > -41cac4c3df656a87bb38363fdcd745e6 996 delay-moov-elst-signal-second-frag-discont-largets
> > > > +dc695d65e8a0cdafee28acd8a5ccf81a 996 delay-moov-elst-signal-second-frag-discont-largets
> > > > write_data len 110, time nopts, type trailer atom -
> > > > write_data len 1223, time nopts, type header atom ftyp
> > > > write_data len 2572, time -333333, type sync atom sidx
> > > > write_data len 996, time 5166667, type sync atom sidx
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -c3eb39921c90724784d1ab84fac58b34 4939 vfr
> > > > +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr
> > > > write_data len 1223, time nopts, type header atom ftyp
> > > > write_data len 2572, time -333333, type sync atom sidx
> > > > write_data len 996, time 5166667, type sync atom sidx
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -c3eb39921c90724784d1ab84fac58b34 4939 vfr-noduration
> > > > +d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr-noduration
> > > > write_data len 1231, time nopts, type header atom ftyp
> > > > write_data len 1500, time -333333, type sync atom moof
> > > > write_data len 1500, time nopts, type unknown atom -
> > > > @@ -131,7 +131,7 @@ write_data len 1500, time 9666667, type sync atom moof
> > > > write_data len 1500, time nopts, type unknown atom -
> > > > write_data len 1004, time nopts, type unknown atom -
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -5bde1358e246e715b2096daa321c9f1b 9299 large_frag
> > > > +08b6401dc81912e5264245b7233c4ab3 9299 large_frag
> > > > write_data len 1231, time nopts, type header atom ftyp
> > > > write_data len 684, time -33333, type sync atom moof
> > > > write_data len 504, time 800000, type boundary atom moof
> > > > @@ -139,15 +139,15 @@ write_data len 420, time 1266667, type boundary atom moof
> > > > write_data len 668, time 1566667, type sync atom moof
> > > > write_data len 440, time 2233333, type boundary atom moof
> > > > write_data len 262, time nopts, type trailer atom -
> > > > -47cc2460c4b18390c67991cf3251409b 4209 vfr-noduration-interleave
> > > > +a5d087611a9229ba91eb0964cf2f17d9 4209 vfr-noduration-interleave
> > > > write_data len 1231, time nopts, type header atom ftyp
> > > > write_data len 916, time 0, type sync atom moof
> > > > write_data len 908, time 1000000, type sync atom moof
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -c200a345c365dd35a31e7e62a9ae6c10 3203 delay-moov-elst-neg-cts
> > > > +d81c3a0ce5940a2db74c99ad435e0560 3203 delay-moov-elst-neg-cts
> > > > write_data len 36, time nopts, type header atom ftyp
> > > > write_data len 1123, time nopts, type header atom -
> > > > write_data len 900, time 0, type sync atom moof
> > > > write_data len 908, time 1000000, type sync atom moof
> > > > write_data len 148, time nopts, type trailer atom -
> > > > -868bb53d861d81b1c15ef4d59afc83b5 3115 empty-moov-neg-cts
> > > > +3be575022e446855bca1e45b7942cc0c 3115 empty-moov-neg-cts
> > > > diff --git a/tests/ref/fate/sub2video b/tests/ref/fate/sub2video
> > > > index 4e034a5..80abe9c 100644
> > > > --- a/tests/ref/fate/sub2video
> > > > +++ b/tests/ref/fate/sub2video
> > > > @@ -10,7 +10,7 @@
> > > > 0,          0,          0,        1,   518400, 0x83c27b82
> > > > 0,          1,          1,        1,   518400, 0x4051c7f9
> > > > 0,          2,          2,        1,   518400, 0xfb00e17e
> > > > -1,     499000,     499000,  4960000,     1015, 0x19e092d2, F=0x0
> > > > +1,     499000,     499000,  4960000,     1015, 0x19e092d2
> > > > 0,          3,          3,        1,   518400, 0x192abb74
> > > > 0,          4,          4,        1,   518400, 0x4669a88b
> > > > 0,          5,          5,        1,   518400, 0xaababe00
> > > > @@ -58,129 +58,129 @@
> > > > 0,         47,         47,        1,   518400, 0xde69683f
> > > > 0,         48,         48,        1,   518400, 0x7df08fba
> > > > 0,         49,         49,        1,   518400, 0xbab197ea
> > > > -1,   15355000,   15355000,  4733000,     2094, 0x3c171425, F=0x0
> > > > +1,   15355000,   15355000,  4733000,     2094, 0x3c171425
> > > > 0,         77,         77,        1,   518400, 0x902285d9
> > > > 0,        100,        100,        1,   518400, 0xbab197ea
> > > > -1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21, F=0x0
> > > > +1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21
> > > > 0,        244,        244,        1,   518400, 0x7a11c812
> > > > 0,        257,        257,        1,   518400, 0xbab197ea
> > > > -1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05, F=0x0
> > > > +1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05
> > > > 0,        258,        258,        1,   518400, 0x34cdddee
> > > > 0,        269,        269,        1,   518400, 0xbab197ea
> > > > -1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed, F=0x0
> > > > +1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed
> > > > 0,        270,        270,        1,   518400, 0x4db4ce51
> > > > 0,        283,        283,        1,   518400, 0xbab197ea
> > > > -1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7, F=0x0
> > > > +1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7
> > > > 0,        284,        284,        1,   518400, 0xe6bc0ea9
> > > > 0,        290,        290,        1,   518400, 0xbab197ea
> > > > -1,   58014000,   58014000,  1661000,      969, 0xe01878f0, F=0x0
> > > > +1,   58014000,   58014000,  1661000,      969, 0xe01878f0
> > > > 0,        291,        291,        1,   518400, 0xa8643af7
> > > > 0,        298,        298,        1,   518400, 0xbab197ea
> > > > -1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1, F=0x0
> > > > +1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1
> > > > 0,        339,        339,        1,   518400, 0xb1885c67
> > > > 0,        345,        345,        1,   518400, 0xbab197ea
> > > > -1,   69175000,   69175000,  1558000,      802, 0xf48531ba, F=0x0
> > > > +1,   69175000,   69175000,  1558000,      802, 0xf48531ba
> > > > 0,        346,        346,        1,   518400, 0x378e3fd0
> > > > 0,        354,        354,        1,   518400, 0xbab197ea
> > > > -1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd, F=0x0
> > > > +1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd
> > > > 0,        355,        355,        1,   518400, 0xa3782469
> > > > 0,        363,        363,        1,   518400, 0xbab197ea
> > > > -1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82, F=0x0
> > > > +1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82
> > > > 0,        364,        364,        1,   518400, 0xba23a0d5
> > > > 0,        374,        374,        1,   518400, 0xbab197ea
> > > > -1,   74806000,   74806000,  1831000,     2116, 0x96514097, F=0x0
> > > > +1,   74806000,   74806000,  1831000,     2116, 0x96514097
> > > > 0,        375,        375,        1,   518400, 0x129de2f8
> > > > 0,        383,        383,        1,   518400, 0xbab197ea
> > > > -1,   76716000,   76716000,  1262000,     1822, 0xefccc72e, F=0x0
> > > > +1,   76716000,   76716000,  1262000,     1822, 0xefccc72e
> > > > 0,        384,        384,        1,   518400, 0x19772f0f
> > > > 0,        390,        390,        1,   518400, 0xbab197ea
> > > > -1,   78051000,   78051000,  1524000,      987, 0x7b927a27, F=0x0
> > > > +1,   78051000,   78051000,  1524000,      987, 0x7b927a27
> > > > 0,        391,        391,        1,   518400, 0x56f54e73
> > > > 0,        398,        398,        1,   518400, 0xbab197ea
> > > > -1,   79644000,   79644000,  2662000,     2956, 0x190778f7, F=0x0
> > > > +1,   79644000,   79644000,  2662000,     2956, 0x190778f7
> > > > 0,        399,        399,        1,   518400, 0x300b5247
> > > > -1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3, F=0x0
> > > > +1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3
> > > > 0,        412,        412,        1,   518400, 0xbab197ea
> > > > 0,        413,        413,        1,   518400, 0x6fd028fa
> > > > 0,        426,        426,        1,   518400, 0xbab197ea
> > > > -1,   85225000,   85225000,  2366000,     2585, 0x74d0048f, F=0x0
> > > > +1,   85225000,   85225000,  2366000,     2585, 0x74d0048f
> > > > 0,        427,        427,        1,   518400, 0x01f80e9d
> > > > 0,        438,        438,        1,   518400, 0xbab197ea
> > > > -1,   87652000,   87652000,  1831000,      634, 0x8832fda1, F=0x0
> > > > +1,   87652000,   87652000,  1831000,      634, 0x8832fda1
> > > > 0,        439,        439,        1,   518400, 0xb48d90c0
> > > > 0,        447,        447,        1,   518400, 0xbab197ea
> > > > -1,   91531000,   91531000,  2332000,     2080, 0x97a1146f, F=0x0
> > > > +1,   91531000,   91531000,  2332000,     2080, 0x97a1146f
> > > > 0,        458,        458,        1,   518400, 0xcb5a0173
> > > > 0,        469,        469,        1,   518400, 0xbab197ea
> > > > -1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684, F=0x0
> > > > +1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684
> > > > 0,        478,        478,        1,   518400, 0xb8a323e4
> > > > 0,        494,        494,        1,   518400, 0xbab197ea
> > > > -1,   98872000,   98872000,  2161000,     1875, 0x9002ef71, F=0x0
> > > > +1,   98872000,   98872000,  2161000,     1875, 0x9002ef71
> > > > 0,        495,        495,        1,   518400, 0xc43518ba
> > > > 0,        505,        505,        1,   518400, 0xbab197ea
> > > > -1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c, F=0x0
> > > > +1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c
> > > > 0,        506,        506,        1,   518400, 0x04e38692
> > > > 0,        526,        526,        1,   518400, 0xbab197ea
> > > > -1,  105303000,  105303000,  2730000,     3094, 0xf203a663, F=0x0
> > > > +1,  105303000,  105303000,  2730000,     3094, 0xf203a663
> > > > 0,        527,        527,        1,   518400, 0x856b0ee5
> > > > 0,        540,        540,        1,   518400, 0xbab197ea
> > > > -1,  108106000,  108106000,  2059000,     2404, 0x41a7b429, F=0x0
> > > > +1,  108106000,  108106000,  2059000,     2404, 0x41a7b429
> > > > 0,        541,        541,        1,   518400, 0x3e5beee2
> > > > 0,        551,        551,        1,   518400, 0xbab197ea
> > > > -1,  141556000,  141556000,  1661000,     1088, 0xde20aa20, F=0x0
> > > > +1,  141556000,  141556000,  1661000,     1088, 0xde20aa20
> > > > 0,        708,        708,        1,   518400, 0xb8bc1365
> > > > 0,        716,        716,        1,   518400, 0xbab197ea
> > > > 0,        817,        817,        1,   518400, 0x83efa32d
> > > > -1,  163445000,  163445000,  1331000,      339, 0x8bd186ef, F=0x0
> > > > +1,  163445000,  163445000,  1331000,      339, 0x8bd186ef
> > > > 0,        824,        824,        1,   518400, 0xbab197ea
> > > > 0,        840,        840,        1,   518400, 0x03ea0e90
> > > > -1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d, F=0x0
> > > > +1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d
> > > > 0,        850,        850,        1,   518400, 0xbab197ea
> > > > -1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe, F=0x0
> > > > +1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe
> > > > 0,        851,        851,        1,   518400, 0x8780239e
> > > > 0,        858,        858,        1,   518400, 0xbab197ea
> > > > 0,        861,        861,        1,   518400, 0x6eb72347
> > > > -1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769, F=0x0
> > > > +1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769
> > > > 0,        869,        869,        1,   518400, 0xbab197ea
> > > > -1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc, F=0x0
> > > > +1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc
> > > > 0,        870,        870,        1,   518400, 0x9c4a3a3d
> > > > 0,        879,        879,        1,   518400, 0xbab197ea
> > > > -1,  175957000,  175957000,  1763000,     1019, 0x20409355, F=0x0
> > > > +1,  175957000,  175957000,  1763000,     1019, 0x20409355
> > > > 0,        880,        880,        1,   518400, 0xc9ebfa89
> > > > 0,        889,        889,        1,   518400, 0xbab197ea
> > > > 0,        946,        946,        1,   518400, 0xbaf801ef
> > > > -1,  189295000,  189295000,  1968000,     1596, 0x408c726e, F=0x0
> > > > +1,  189295000,  189295000,  1968000,     1596, 0x408c726e
> > > > 0,        956,        956,        1,   518400, 0xbab197ea
> > > > -1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b, F=0x0
> > > > +1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b
> > > > 0,        957,        957,        1,   518400, 0x59f4e72f
> > > > 0,        963,        963,        1,   518400, 0xbab197ea
> > > > -1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4, F=0x0
> > > > +1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4
> > > > 0,        964,        964,        1,   518400, 0x9d5b9d69
> > > > 0,        972,        972,        1,   518400, 0xbab197ea
> > > > -1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8, F=0x0
> > > > +1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8
> > > > 0,        976,        976,        1,   518400, 0x923d1ce7
> > > > 0,        981,        981,        1,   518400, 0xbab197ea
> > > > -1,  196361000,  196361000,  1524000,     1715, 0x695ca41e, F=0x0
> > > > +1,  196361000,  196361000,  1524000,     1715, 0x695ca41e
> > > > 0,        982,        982,        1,   518400, 0x6e652cd2
> > > > 0,        989,        989,        1,   518400, 0xbab197ea
> > > > -1,  197946000,  197946000,  1160000,      789, 0xc63a189e, F=0x0
> > > > +1,  197946000,  197946000,  1160000,      789, 0xc63a189e
> > > > 0,        990,        990,        1,   518400, 0x25113966
> > > > 0,        996,        996,        1,   518400, 0xbab197ea
> > > > -1,  199230000,  199230000,  1627000,     1846, 0xeea8c599, F=0x0
> > > > +1,  199230000,  199230000,  1627000,     1846, 0xeea8c599
> > > > 0,        997,        997,        1,   518400, 0x2dc83609
> > > > 0,       1004,       1004,        1,   518400, 0xbab197ea
> > > > -1,  200924000,  200924000,  1763000,      922, 0xd4a87222, F=0x0
> > > > +1,  200924000,  200924000,  1763000,      922, 0xd4a87222
> > > > 0,       1005,       1005,        1,   518400, 0x90483bc6
> > > > 0,       1013,       1013,        1,   518400, 0xbab197ea
> > > > 0,       1053,       1053,        1,   518400, 0x3de86ab7
> > > > -1,  210600000,  210600000,  1831000,      665, 0x55580135, F=0x0
> > > > +1,  210600000,  210600000,  1831000,      665, 0x55580135
> > > > 0,       1062,       1062,        1,   518400, 0xbab197ea
> > > > -1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5, F=0x0
> > > > +1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5
> > > > 0,       1074,       1074,        1,   518400, 0x8c320e68
> > > > 0,       1082,       1082,        1,   518400, 0xbab197ea
> > > > 0,       1128,       1128,        1,   518400, 0x81e977b2
> > > > -1,  225640000,  225640000,  2127000,     2133, 0x670c11a5, F=0x0
> > > > +1,  225640000,  225640000,  2127000,     2133, 0x670c11a5
> > > > 0,       1139,       1139,        1,   518400, 0xbab197ea
> > > > -1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57, F=0x0
> > > > +1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57
> > > > 0,       1140,       1140,        1,   518400, 0xb046dd30
> > > > 0,       1145,       1145,        1,   518400, 0xbab197ea
> > > > -- > 2.9.5
> > > > > _______________________________________________
> > > > ffmpeg-devel mailing list
> > > > ffmpeg-devel@ffmpeg.org
> > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > > > > To unsubscribe, visit link above, or email
> > > > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> > > _______________________________________________
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel@ffmpeg.org
> > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > > 
> > > To unsubscribe, visit link above, or email
> > > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> > 
> > -- 
> > Thanks,
> > Limin Wang
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > 
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavformat/internal.h b/libavformat/internal.h
index 716e42c..c4fac5c 100644
--- a/libavformat/internal.h
+++ b/libavformat/internal.h
@@ -189,6 +189,8 @@  struct AVStreamInternal {
      */
     int need_context_update;
 
+    int is_intra_only;
+
     FFFrac *priv_pts;
 };
 
diff --git a/libavformat/mux.c b/libavformat/mux.c
index a6253f5..ea6524f 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -357,6 +357,8 @@  FF_ENABLE_DEPRECATION_WARNINGS
         if (desc && desc->props & AV_CODEC_PROP_REORDER)
             st->internal->reorder = 1;
 
+        st->internal->is_intra_only = ff_is_intra_only(par->codec_id);
+
         if (of->codec_tag) {
             if (   par->codec_tag
                 && par->codec_id == AV_CODEC_ID_RAWVIDEO
@@ -773,6 +775,7 @@  static int check_packet(AVFormatContext *s, AVPacket *pkt)
 static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
 {
     int ret;
+    AVStream *st = s->streams[pkt->stream_index];
 
     ret = check_packet(s, pkt);
     if (ret < 0)
@@ -781,7 +784,6 @@  static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
 #if !FF_API_COMPUTE_PKT_FIELDS2 || !FF_API_LAVF_AVCTX
     /* sanitize the timestamps */
     if (!(s->oformat->flags & AVFMT_NOTIMESTAMPS)) {
-        AVStream *st = s->streams[pkt->stream_index];
 
         /* when there is no reordering (so dts is equal to pts), but
          * only one of them is set, set the other as well */
@@ -818,6 +820,9 @@  static int prepare_input_packet(AVFormatContext *s, AVPacket *pkt)
         }
     }
 #endif
+    /* update flags */
+    if (st->internal->is_intra_only)
+        pkt->flags |= AV_PKT_FLAG_KEY;
 
     return 0;
 }
diff --git a/tests/ref/fate/binsub-movtextenc b/tests/ref/fate/binsub-movtextenc
index 78c05f4..a8f94b7 100644
--- a/tests/ref/fate/binsub-movtextenc
+++ b/tests/ref/fate/binsub-movtextenc
@@ -1 +1 @@ 
-35adf776cd73e808186ae7124445f4b8
+fc6d07679ac1f718aa50de687924cd97
diff --git a/tests/ref/fate/movenc b/tests/ref/fate/movenc
index 637a347..fb39b98 100644
--- a/tests/ref/fate/movenc
+++ b/tests/ref/fate/movenc
@@ -2,17 +2,17 @@  write_data len 36, time nopts, type header atom ftyp
 write_data len 2389, time nopts, type header atom -
 write_data len 788, time 1000000, type sync atom moof
 write_data len 110, time nopts, type trailer atom -
-66cf48604f039aa9a51711786f5c8778 3323 non-empty-moov
+5f401347fc3c771b819e2449d69d4861 3323 non-empty-moov
 write_data len 36, time nopts, type header atom ftyp
 write_data len 2721, time nopts, type header atom -
 write_data len 908, time 966667, type sync atom moof
 write_data len 110, time nopts, type trailer atom -
-04b2e86f455af94f9258b8d66dbf71f5 3775 non-empty-moov-elst
+4267feee527adf8cd4f7b36ac0fc0872 3775 non-empty-moov-elst
 write_data len 36, time nopts, type header atom ftyp
 write_data len 2629, time nopts, type header atom -
 write_data len 908, time 1000000, type sync atom moof
 write_data len 110, time nopts, type trailer atom -
-e9f6fa032d6d8265d67aef5de81a48bf 3683 non-empty-moov-no-elst
+44077b9ad45f3e16fafe4e5ada54e9b0 3683 non-empty-moov-no-elst
 write_data len 24, time nopts, type header atom ftyp
 write_data len 1171, time nopts, type header atom -
 write_data len 728, time 0, type sync atom moof
@@ -20,35 +20,35 @@  write_data len 828, time nopts, type unknown atom -
 write_data len 728, time 999999, type sync atom moof
 write_data len 812, time nopts, type unknown atom -
 write_data len 148, time nopts, type trailer atom -
-da105e0b2c19079519c6eed7d5a1151c 4439 ismv
+92ce825ff40505ec8676191705adb7e7 4439 ismv
 write_data len 36, time nopts, type header atom ftyp
 write_data len 1123, time nopts, type header atom -
 write_data len 796, time 0, type sync atom moof
 write_data len 788, time 1000000, type sync atom moof
 write_data len 148, time nopts, type trailer atom -
-e6a4b15443d006efd727a80f6624b7db 2891 empty-moov
+08f4b3ad3a3ea224b2ee731476b9056b 2891 empty-moov
 write_data len 36, time nopts, type header atom ftyp
 write_data len 1123, time nopts, type header atom -
 write_data len 1068, time 0, type sync atom moof
 write_data len 908, time 1000000, type sync atom moof
 write_data len 148, time nopts, type trailer atom -
-800f854aff2ac76dfaddebd0562c75b9 3283 empty-moov-no-elst
+d7a2dcb43eb0f95f92669f55fc7adeba 3283 empty-moov-no-elst
 write_data len 36, time nopts, type header atom ftyp
 write_data len 1123, time nopts, type header atom -
 write_data len 900, time -33333, type sync atom moof
 write_data len 908, time 966667, type sync atom moof
 write_data len 148, time nopts, type trailer atom -
-eca1a945c9063dab0858af6b85925533 3115 empty-moov-no-elst-no-adjust
+ea70ca697306976879be408431c27aee 3115 empty-moov-no-elst-no-adjust
 write_data len 1159, time nopts, type header atom ftyp
 write_data len 796, time 0, type sync atom moof
 write_data len 788, time 1000000, type sync atom moof
 write_data len 148, time nopts, type trailer atom -
-e6a4b15443d006efd727a80f6624b7db 2891 delay-moov
+08f4b3ad3a3ea224b2ee731476b9056b 2891 delay-moov
 write_data len 1231, time nopts, type header atom ftyp
 write_data len 916, time -33333, type sync atom moof
 write_data len 908, time 966667, type sync atom moof
 write_data len 148, time nopts, type trailer atom -
-c2ecdbc80668fcee73f5a039e2dba579 3203 delay-moov-elst
+314cc3b6296f4ee583b328a34be50b2f 3203 delay-moov-elst
 write_data len 1195, time nopts, type header atom ftyp
 write_data len 836, time 0, type sync atom moof
 write_data len 67, time nopts, type trailer atom -
@@ -63,66 +63,66 @@  write_data len 1123, time nopts, type header atom -
 351ae2c8b6d35d98b4848c309cce6704 1159 empty-moov-header
 write_data len 796, time 0, type sync atom moof
 write_data len 788, time 1000000, type sync atom moof
-a0165f4a26a409212b0946e981bdefb9 1584 empty-moov-content
+289ee982188d66988a374a462b0b5376 1584 empty-moov-content
 write_data len 148, time nopts, type trailer atom -
 write_data len 1159, time nopts, type header atom ftyp
 351ae2c8b6d35d98b4848c309cce6704 1159 delay-moov-header
 write_data len 796, time 0, type sync atom moof
 write_data len 788, time 1000000, type sync atom moof
-a0165f4a26a409212b0946e981bdefb9 1584 delay-moov-content
+289ee982188d66988a374a462b0b5376 1584 delay-moov-content
 write_data len 148, time nopts, type trailer atom -
 write_data len 28, time nopts, type header atom -
 write_data len 1123, time nopts, type header atom -
 write_data len 884, time 0, type sync atom sidx
 write_data len 876, time 1000000, type sync atom sidx
-272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag
+c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag
 write_data len 148, time nopts, type trailer atom -
 write_data len 28, time nopts, type header atom -
 write_data len 1123, time nopts, type header atom -
 write_data len 876, time 1000000, type sync atom sidx
-272a474cfd2a68cc5f05b426b14a2b7d 876 empty-moov-second-frag-discont
+c0307f99a2a362205b7e3d65b1066f86 876 empty-moov-second-frag-discont
 write_data len 110, time nopts, type trailer atom -
 write_data len 1223, time nopts, type header atom -
 write_data len 876, time 1000000, type sync atom sidx
-272a474cfd2a68cc5f05b426b14a2b7d 876 delay-moov-second-frag-discont
+c0307f99a2a362205b7e3d65b1066f86 876 delay-moov-second-frag-discont
 write_data len 110, time nopts, type trailer atom -
 write_data len 1223, time nopts, type header atom ftyp
 b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init
 write_data len 988, time -33333, type sync atom sidx
 write_data len 996, time 966667, type sync atom sidx
-fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag
+0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag
 write_data len 148, time nopts, type trailer atom -
 write_data len 1223, time nopts, type header atom ftyp
 b3811928793ed0749927eb2f7958421c 1223 delay-moov-elst-init-discont
 write_data len 996, time 966667, type sync atom sidx
-fcae8f40e015b59aabc8d4a99a759ca1 996 delay-moov-elst-second-frag-discont
+0df125407c7e81978ce722e0ae4f6f84 996 delay-moov-elst-second-frag-discont
 write_data len 110, time nopts, type trailer atom -
 write_data len 1223, time nopts, type header atom ftyp
 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init
 write_data len 1004, time -33333, type sync atom sidx
 write_data len 996, time 966667, type sync atom sidx
-aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag
+5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag
 write_data len 148, time nopts, type trailer atom -
 write_data len 1223, time nopts, type header atom ftyp
 041ac8efc35a0d023c26d05eedb20403 1223 delay-moov-elst-signal-init-discont
 write_data len 996, time 966667, type sync atom sidx
-aa5462cc0d2144f72154d9c309edb57d 996 delay-moov-elst-signal-second-frag-discont
+5a583d89318827d2569eecbeaa18c238 996 delay-moov-elst-signal-second-frag-discont
 write_data len 110, time nopts, type trailer atom -
 write_data len 1247, time nopts, type header atom ftyp
 80511a51d1ac9cde62337eed7176ae03 1247 delay-moov-elst-signal-init-discont-largets
 write_data len 996, time 279621233333, type sync atom sidx
-41cac4c3df656a87bb38363fdcd745e6 996 delay-moov-elst-signal-second-frag-discont-largets
+dc695d65e8a0cdafee28acd8a5ccf81a 996 delay-moov-elst-signal-second-frag-discont-largets
 write_data len 110, time nopts, type trailer atom -
 write_data len 1223, time nopts, type header atom ftyp
 write_data len 2572, time -333333, type sync atom sidx
 write_data len 996, time 5166667, type sync atom sidx
 write_data len 148, time nopts, type trailer atom -
-c3eb39921c90724784d1ab84fac58b34 4939 vfr
+d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr
 write_data len 1223, time nopts, type header atom ftyp
 write_data len 2572, time -333333, type sync atom sidx
 write_data len 996, time 5166667, type sync atom sidx
 write_data len 148, time nopts, type trailer atom -
-c3eb39921c90724784d1ab84fac58b34 4939 vfr-noduration
+d37a7eda807912b9ed05ccfe003a9e4f 4939 vfr-noduration
 write_data len 1231, time nopts, type header atom ftyp
 write_data len 1500, time -333333, type sync atom moof
 write_data len 1500, time nopts, type unknown atom -
@@ -131,7 +131,7 @@  write_data len 1500, time 9666667, type sync atom moof
 write_data len 1500, time nopts, type unknown atom -
 write_data len 1004, time nopts, type unknown atom -
 write_data len 148, time nopts, type trailer atom -
-5bde1358e246e715b2096daa321c9f1b 9299 large_frag
+08b6401dc81912e5264245b7233c4ab3 9299 large_frag
 write_data len 1231, time nopts, type header atom ftyp
 write_data len 684, time -33333, type sync atom moof
 write_data len 504, time 800000, type boundary atom moof
@@ -139,15 +139,15 @@  write_data len 420, time 1266667, type boundary atom moof
 write_data len 668, time 1566667, type sync atom moof
 write_data len 440, time 2233333, type boundary atom moof
 write_data len 262, time nopts, type trailer atom -
-47cc2460c4b18390c67991cf3251409b 4209 vfr-noduration-interleave
+a5d087611a9229ba91eb0964cf2f17d9 4209 vfr-noduration-interleave
 write_data len 1231, time nopts, type header atom ftyp
 write_data len 916, time 0, type sync atom moof
 write_data len 908, time 1000000, type sync atom moof
 write_data len 148, time nopts, type trailer atom -
-c200a345c365dd35a31e7e62a9ae6c10 3203 delay-moov-elst-neg-cts
+d81c3a0ce5940a2db74c99ad435e0560 3203 delay-moov-elst-neg-cts
 write_data len 36, time nopts, type header atom ftyp
 write_data len 1123, time nopts, type header atom -
 write_data len 900, time 0, type sync atom moof
 write_data len 908, time 1000000, type sync atom moof
 write_data len 148, time nopts, type trailer atom -
-868bb53d861d81b1c15ef4d59afc83b5 3115 empty-moov-neg-cts
+3be575022e446855bca1e45b7942cc0c 3115 empty-moov-neg-cts
diff --git a/tests/ref/fate/sub2video b/tests/ref/fate/sub2video
index 4e034a5..80abe9c 100644
--- a/tests/ref/fate/sub2video
+++ b/tests/ref/fate/sub2video
@@ -10,7 +10,7 @@ 
 0,          0,          0,        1,   518400, 0x83c27b82
 0,          1,          1,        1,   518400, 0x4051c7f9
 0,          2,          2,        1,   518400, 0xfb00e17e
-1,     499000,     499000,  4960000,     1015, 0x19e092d2, F=0x0
+1,     499000,     499000,  4960000,     1015, 0x19e092d2
 0,          3,          3,        1,   518400, 0x192abb74
 0,          4,          4,        1,   518400, 0x4669a88b
 0,          5,          5,        1,   518400, 0xaababe00
@@ -58,129 +58,129 @@ 
 0,         47,         47,        1,   518400, 0xde69683f
 0,         48,         48,        1,   518400, 0x7df08fba
 0,         49,         49,        1,   518400, 0xbab197ea
-1,   15355000,   15355000,  4733000,     2094, 0x3c171425, F=0x0
+1,   15355000,   15355000,  4733000,     2094, 0x3c171425
 0,         77,         77,        1,   518400, 0x902285d9
 0,        100,        100,        1,   518400, 0xbab197ea
-1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21, F=0x0
+1,   48797000,   48797000,  2560000,     2480, 0x7c0edf21
 0,        244,        244,        1,   518400, 0x7a11c812
 0,        257,        257,        1,   518400, 0xbab197ea
-1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05, F=0x0
+1,   51433000,   51433000,  2366000,     3059, 0xc95b8a05
 0,        258,        258,        1,   518400, 0x34cdddee
 0,        269,        269,        1,   518400, 0xbab197ea
-1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed, F=0x0
+1,   53910000,   53910000,  2696000,     2095, 0x61bb15ed
 0,        270,        270,        1,   518400, 0x4db4ce51
 0,        283,        283,        1,   518400, 0xbab197ea
-1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7, F=0x0
+1,   56663000,   56663000,  1262000,     1013, 0xc9ae89b7
 0,        284,        284,        1,   518400, 0xe6bc0ea9
 0,        290,        290,        1,   518400, 0xbab197ea
-1,   58014000,   58014000,  1661000,      969, 0xe01878f0, F=0x0
+1,   58014000,   58014000,  1661000,      969, 0xe01878f0
 0,        291,        291,        1,   518400, 0xa8643af7
 0,        298,        298,        1,   518400, 0xbab197ea
-1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1, F=0x0
+1,   67724000,   67724000,  1365000,      844, 0xe7db4fc1
 0,        339,        339,        1,   518400, 0xb1885c67
 0,        345,        345,        1,   518400, 0xbab197ea
-1,   69175000,   69175000,  1558000,      802, 0xf48531ba, F=0x0
+1,   69175000,   69175000,  1558000,      802, 0xf48531ba
 0,        346,        346,        1,   518400, 0x378e3fd0
 0,        354,        354,        1,   518400, 0xbab197ea
-1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd, F=0x0
+1,   70819000,   70819000,  1865000,     1709, 0xb4d5a1bd
 0,        355,        355,        1,   518400, 0xa3782469
 0,        363,        363,        1,   518400, 0xbab197ea
-1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82, F=0x0
+1,   72762000,   72762000,  1968000,     2438, 0x99d7bc82
 0,        364,        364,        1,   518400, 0xba23a0d5
 0,        374,        374,        1,   518400, 0xbab197ea
-1,   74806000,   74806000,  1831000,     2116, 0x96514097, F=0x0
+1,   74806000,   74806000,  1831000,     2116, 0x96514097
 0,        375,        375,        1,   518400, 0x129de2f8
 0,        383,        383,        1,   518400, 0xbab197ea
-1,   76716000,   76716000,  1262000,     1822, 0xefccc72e, F=0x0
+1,   76716000,   76716000,  1262000,     1822, 0xefccc72e
 0,        384,        384,        1,   518400, 0x19772f0f
 0,        390,        390,        1,   518400, 0xbab197ea
-1,   78051000,   78051000,  1524000,      987, 0x7b927a27, F=0x0
+1,   78051000,   78051000,  1524000,      987, 0x7b927a27
 0,        391,        391,        1,   518400, 0x56f54e73
 0,        398,        398,        1,   518400, 0xbab197ea
-1,   79644000,   79644000,  2662000,     2956, 0x190778f7, F=0x0
+1,   79644000,   79644000,  2662000,     2956, 0x190778f7
 0,        399,        399,        1,   518400, 0x300b5247
-1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3, F=0x0
+1,   82380000,   82380000,  2764000,     3094, 0xc021b7d3
 0,        412,        412,        1,   518400, 0xbab197ea
 0,        413,        413,        1,   518400, 0x6fd028fa
 0,        426,        426,        1,   518400, 0xbab197ea
-1,   85225000,   85225000,  2366000,     2585, 0x74d0048f, F=0x0
+1,   85225000,   85225000,  2366000,     2585, 0x74d0048f
 0,        427,        427,        1,   518400, 0x01f80e9d
 0,        438,        438,        1,   518400, 0xbab197ea
-1,   87652000,   87652000,  1831000,      634, 0x8832fda1, F=0x0
+1,   87652000,   87652000,  1831000,      634, 0x8832fda1
 0,        439,        439,        1,   518400, 0xb48d90c0
 0,        447,        447,        1,   518400, 0xbab197ea
-1,   91531000,   91531000,  2332000,     2080, 0x97a1146f, F=0x0
+1,   91531000,   91531000,  2332000,     2080, 0x97a1146f
 0,        458,        458,        1,   518400, 0xcb5a0173
 0,        469,        469,        1,   518400, 0xbab197ea
-1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684, F=0x0
+1,   95510000,   95510000,  3299000,     2964, 0x8b8f6684
 0,        478,        478,        1,   518400, 0xb8a323e4
 0,        494,        494,        1,   518400, 0xbab197ea
-1,   98872000,   98872000,  2161000,     1875, 0x9002ef71, F=0x0
+1,   98872000,   98872000,  2161000,     1875, 0x9002ef71
 0,        495,        495,        1,   518400, 0xc43518ba
 0,        505,        505,        1,   518400, 0xbab197ea
-1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c, F=0x0
+1,  101124000,  101124000,  4096000,     3872, 0x20c6ed9c
 0,        506,        506,        1,   518400, 0x04e38692
 0,        526,        526,        1,   518400, 0xbab197ea
-1,  105303000,  105303000,  2730000,     3094, 0xf203a663, F=0x0
+1,  105303000,  105303000,  2730000,     3094, 0xf203a663
 0,        527,        527,        1,   518400, 0x856b0ee5
 0,        540,        540,        1,   518400, 0xbab197ea
-1,  108106000,  108106000,  2059000,     2404, 0x41a7b429, F=0x0
+1,  108106000,  108106000,  2059000,     2404, 0x41a7b429
 0,        541,        541,        1,   518400, 0x3e5beee2
 0,        551,        551,        1,   518400, 0xbab197ea
-1,  141556000,  141556000,  1661000,     1088, 0xde20aa20, F=0x0
+1,  141556000,  141556000,  1661000,     1088, 0xde20aa20
 0,        708,        708,        1,   518400, 0xb8bc1365
 0,        716,        716,        1,   518400, 0xbab197ea
 0,        817,        817,        1,   518400, 0x83efa32d
-1,  163445000,  163445000,  1331000,      339, 0x8bd186ef, F=0x0
+1,  163445000,  163445000,  1331000,      339, 0x8bd186ef
 0,        824,        824,        1,   518400, 0xbab197ea
 0,        840,        840,        1,   518400, 0x03ea0e90
-1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d, F=0x0
+1,  168049000,  168049000,  1900000,     1312, 0x0bf20e8d
 0,        850,        850,        1,   518400, 0xbab197ea
-1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe, F=0x0
+1,  170035000,  170035000,  1524000,     1279, 0xb6c2dafe
 0,        851,        851,        1,   518400, 0x8780239e
 0,        858,        858,        1,   518400, 0xbab197ea
 0,        861,        861,        1,   518400, 0x6eb72347
-1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769, F=0x0
+1,  172203000,  172203000,  1695000,     1826, 0x9a1ac769
 0,        869,        869,        1,   518400, 0xbab197ea
-1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc, F=0x0
+1,  173947000,  173947000,  1934000,     1474, 0xa9b03cdc
 0,        870,        870,        1,   518400, 0x9c4a3a3d
 0,        879,        879,        1,   518400, 0xbab197ea
-1,  175957000,  175957000,  1763000,     1019, 0x20409355, F=0x0
+1,  175957000,  175957000,  1763000,     1019, 0x20409355
 0,        880,        880,        1,   518400, 0xc9ebfa89
 0,        889,        889,        1,   518400, 0xbab197ea
 0,        946,        946,        1,   518400, 0xbaf801ef
-1,  189295000,  189295000,  1968000,     1596, 0x408c726e, F=0x0
+1,  189295000,  189295000,  1968000,     1596, 0x408c726e
 0,        956,        956,        1,   518400, 0xbab197ea
-1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b, F=0x0
+1,  191356000,  191356000,  1228000,     1517, 0xae8c5c2b
 0,        957,        957,        1,   518400, 0x59f4e72f
 0,        963,        963,        1,   518400, 0xbab197ea
-1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4, F=0x0
+1,  192640000,  192640000,  1763000,     2506, 0xa458d6d4
 0,        964,        964,        1,   518400, 0x9d5b9d69
 0,        972,        972,        1,   518400, 0xbab197ea
-1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8, F=0x0
+1,  195193000,  195193000,  1092000,     1074, 0x397ba9a8
 0,        976,        976,        1,   518400, 0x923d1ce7
 0,        981,        981,        1,   518400, 0xbab197ea
-1,  196361000,  196361000,  1524000,     1715, 0x695ca41e, F=0x0
+1,  196361000,  196361000,  1524000,     1715, 0x695ca41e
 0,        982,        982,        1,   518400, 0x6e652cd2
 0,        989,        989,        1,   518400, 0xbab197ea
-1,  197946000,  197946000,  1160000,      789, 0xc63a189e, F=0x0
+1,  197946000,  197946000,  1160000,      789, 0xc63a189e
 0,        990,        990,        1,   518400, 0x25113966
 0,        996,        996,        1,   518400, 0xbab197ea
-1,  199230000,  199230000,  1627000,     1846, 0xeea8c599, F=0x0
+1,  199230000,  199230000,  1627000,     1846, 0xeea8c599
 0,        997,        997,        1,   518400, 0x2dc83609
 0,       1004,       1004,        1,   518400, 0xbab197ea
-1,  200924000,  200924000,  1763000,      922, 0xd4a87222, F=0x0
+1,  200924000,  200924000,  1763000,      922, 0xd4a87222
 0,       1005,       1005,        1,   518400, 0x90483bc6
 0,       1013,       1013,        1,   518400, 0xbab197ea
 0,       1053,       1053,        1,   518400, 0x3de86ab7
-1,  210600000,  210600000,  1831000,      665, 0x55580135, F=0x0
+1,  210600000,  210600000,  1831000,      665, 0x55580135
 0,       1062,       1062,        1,   518400, 0xbab197ea
-1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5, F=0x0
+1,  214771000,  214771000,  1558000,     1216, 0x50d1f6c5
 0,       1074,       1074,        1,   518400, 0x8c320e68
 0,       1082,       1082,        1,   518400, 0xbab197ea
 0,       1128,       1128,        1,   518400, 0x81e977b2
-1,  225640000,  225640000,  2127000,     2133, 0x670c11a5, F=0x0
+1,  225640000,  225640000,  2127000,     2133, 0x670c11a5
 0,       1139,       1139,        1,   518400, 0xbab197ea
-1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57, F=0x0
+1,  227834000,  227834000,  1262000,     1264, 0xc1d9fc57
 0,       1140,       1140,        1,   518400, 0xb046dd30
 0,       1145,       1145,        1,   518400, 0xbab197ea