diff mbox series

[FFmpeg-devel] lavf/movenc: mark mov/mp4 as supporting VFR

Message ID 20240329083509.10130-1-anton@khirnov.net
State New
Headers show
Series [FFmpeg-devel] lavf/movenc: mark mov/mp4 as supporting VFR | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Anton Khirnov March 29, 2024, 8:35 a.m. UTC
---
 libavformat/movenc.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Gyan Doshi March 29, 2024, 9:19 a.m. UTC | #1
On 2024-03-29 02:05 pm, Anton Khirnov wrote:
> ---
>   libavformat/movenc.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index b97c479cc4..30cfbf6e74 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -8230,11 +8230,11 @@ const FFOutputFormat ff_mov_muxer = {
>       .write_packet      = mov_write_packet,
>       .write_trailer     = mov_write_trailer,
>       .deinit            = mov_free,
> +    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE | AVFMT_VARIABLE_FPS
>   #if FF_API_ALLOW_FLUSH
> -    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
> -#else
> -    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
> +                       | AVFMT_ALLOW_FLUSH
>   #endif
> +                         ,
>       .p.codec_tag       = (const AVCodecTag* const []){
>           ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0
>       },
> @@ -8282,11 +8282,11 @@ const FFOutputFormat ff_mp4_muxer = {
>       .write_packet      = mov_write_packet,
>       .write_trailer     = mov_write_trailer,
>       .deinit            = mov_free,
> +    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE | AVFMT_VARIABLE_FPS
>   #if FF_API_ALLOW_FLUSH
> -    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
> -#else
> -    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
> +                       | AVFMT_ALLOW_FLUSH
>   #endif
> +                         ,
>       .p.codec_tag       = mp4_codec_tags_list,
>       .check_bitstream   = mov_check_bitstream,
>       .p.priv_class      = &mov_isobmff_muxer_class,

LGTM. Should have been done a long time ago.
What about the other muxers in movenc?

Regards,
Gyan
Anton Khirnov March 29, 2024, 9:21 a.m. UTC | #2
Quoting Gyan Doshi (2024-03-29 10:19:15)
> LGTM. Should have been done a long time ago.
> What about the other muxers in movenc?

I don't know what they are used for or what constraints they have, so I
left them alone for now. Can also change them if people see no problem
with it.
Michael Niedermayer March 30, 2024, 12:52 a.m. UTC | #3
On Fri, Mar 29, 2024 at 09:35:09AM +0100, Anton Khirnov wrote:
> ---
>  libavformat/movenc.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

can you add a fate test for this ?
its odd we have no single test that changes from this

thx

[...]
James Almer March 30, 2024, 12:49 p.m. UTC | #4
On 3/29/2024 5:35 AM, Anton Khirnov wrote:
> ---
>   libavformat/movenc.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/libavformat/movenc.c b/libavformat/movenc.c
> index b97c479cc4..30cfbf6e74 100644
> --- a/libavformat/movenc.c
> +++ b/libavformat/movenc.c
> @@ -8230,11 +8230,11 @@ const FFOutputFormat ff_mov_muxer = {
>       .write_packet      = mov_write_packet,
>       .write_trailer     = mov_write_trailer,
>       .deinit            = mov_free,
> +    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE | AVFMT_VARIABLE_FPS
>   #if FF_API_ALLOW_FLUSH
> -    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
> -#else
> -    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
> +                       | AVFMT_ALLOW_FLUSH
>   #endif
> +                         ,
>       .p.codec_tag       = (const AVCodecTag* const []){
>           ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0
>       },
> @@ -8282,11 +8282,11 @@ const FFOutputFormat ff_mp4_muxer = {
>       .write_packet      = mov_write_packet,
>       .write_trailer     = mov_write_trailer,
>       .deinit            = mov_free,
> +    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE | AVFMT_VARIABLE_FPS
>   #if FF_API_ALLOW_FLUSH
> -    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
> -#else
> -    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
> +                       | AVFMT_ALLOW_FLUSH
>   #endif
> +                         ,
>       .p.codec_tag       = mp4_codec_tags_list,
>       .check_bitstream   = mov_check_bitstream,
>       .p.priv_class      = &mov_isobmff_muxer_class,

There's a custom check for these muxers in 
avformat_transfer_internal_stream_timing_info() that would afaict be 
disabled with this change.
diff mbox series

Patch

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index b97c479cc4..30cfbf6e74 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -8230,11 +8230,11 @@  const FFOutputFormat ff_mov_muxer = {
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE | AVFMT_VARIABLE_FPS
 #if FF_API_ALLOW_FLUSH
-    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-#else
-    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+                       | AVFMT_ALLOW_FLUSH
 #endif
+                         ,
     .p.codec_tag       = (const AVCodecTag* const []){
         ff_codec_movvideo_tags, ff_codec_movaudio_tags, ff_codec_movsubtitle_tags, 0
     },
@@ -8282,11 +8282,11 @@  const FFOutputFormat ff_mp4_muxer = {
     .write_packet      = mov_write_packet,
     .write_trailer     = mov_write_trailer,
     .deinit            = mov_free,
+    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE | AVFMT_VARIABLE_FPS
 #if FF_API_ALLOW_FLUSH
-    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_ALLOW_FLUSH | AVFMT_TS_NEGATIVE,
-#else
-    .p.flags           = AVFMT_GLOBALHEADER | AVFMT_TS_NEGATIVE,
+                       | AVFMT_ALLOW_FLUSH
 #endif
+                         ,
     .p.codec_tag       = mp4_codec_tags_list,
     .check_bitstream   = mov_check_bitstream,
     .p.priv_class      = &mov_isobmff_muxer_class,