diff mbox series

[FFmpeg-devel] avformat/webmdashenc: Don't use custom option for bitexactness

Message ID 20200317222758.24511-1-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel] avformat/webmdashenc: Don't use custom option for bitexactness | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Andreas Rheinhardt March 17, 2020, 10:27 p.m. UTC
The WebM DASH Manifest muxer can write manifests for live streams and
these contain an entry that depends on the time the manifest is written;
an AVOption to make the output reproducible has been added for tests.
But this is unnecessary, as there already is a method for reproducible
output: The AVFMT_FLAG_BITEXACT-flag of the AVFormatContext. Therefore
this commit removes the custom option.

Given that the description of said option contained "private option -
users should never set this" and that it was not documented in
muxers.texi, no deprecation period for this option seemed necessary.

The commands of the FATE-tests for this muxer have been changed to no
longer use this option.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/webmdashenc.c | 4 +---
 tests/fate/vpx.mak        | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

Comments

Paul B Mahol March 18, 2020, 9:30 a.m. UTC | #1
LGTM

On 3/17/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
> The WebM DASH Manifest muxer can write manifests for live streams and
> these contain an entry that depends on the time the manifest is written;
> an AVOption to make the output reproducible has been added for tests.
> But this is unnecessary, as there already is a method for reproducible
> output: The AVFMT_FLAG_BITEXACT-flag of the AVFormatContext. Therefore
> this commit removes the custom option.
>
> Given that the description of said option contained "private option -
> users should never set this" and that it was not documented in
> muxers.texi, no deprecation period for this option seemed necessary.
>
> The commands of the FATE-tests for this muxer have been changed to no
> longer use this option.
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavformat/webmdashenc.c | 4 +---
>  tests/fate/vpx.mak        | 4 ++--
>  2 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
> index d2f0e0ec4d..0e7bfba34c 100644
> --- a/libavformat/webmdashenc.c
> +++ b/libavformat/webmdashenc.c
> @@ -57,7 +57,6 @@ typedef struct WebMDashMuxContext {
>      char *utc_timing_url;
>      double time_shift_buffer_depth;
>      int minimum_update_period;
> -    int debug_mode;
>  } WebMDashMuxContext;
>
>  static const char *get_codec_name(int codec_id)
> @@ -114,7 +113,7 @@ static int write_header(AVFormatContext *s)
>          if (!strftime(gmt_iso, 21, "%Y-%m-%dT%H:%M:%SZ", gmt)) {
>              return AVERROR_UNKNOWN;
>          }
> -        if (w->debug_mode) {
> +        if (s->flags & AVFMT_FLAG_BITEXACT) {
>              av_strlcpy(gmt_iso, "", 1);
>          }
>          avio_printf(s->pb, "  availabilityStartTime=\"%s\"\n", gmt_iso);
> @@ -553,7 +552,6 @@ static int
> webm_dash_manifest_write_packet(AVFormatContext *s, AVPacket *pkt)
>  #define OFFSET(x) offsetof(WebMDashMuxContext, x)
>  static const AVOption options[] = {
>      { "adaptation_sets", "Adaptation sets. Syntax: id=0,streams=0,1,2
> id=1,streams=3,4 and so on", OFFSET(adaptation_sets), AV_OPT_TYPE_STRING, {
> 0 }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
> -    { "debug_mode", "[private option - users should never set this]. Create
> deterministic output", OFFSET(debug_mode), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0,
> 1, AV_OPT_FLAG_ENCODING_PARAM },
>      { "live", "create a live stream manifest", OFFSET(is_live),
> AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
>      { "chunk_start_index",  "start index of the chunk",
> OFFSET(chunk_start_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX,
> AV_OPT_FLAG_ENCODING_PARAM },
>      { "chunk_duration_ms", "duration of each chunk (in milliseconds)",
> OFFSET(chunk_duration), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX,
> AV_OPT_FLAG_ENCODING_PARAM },
> diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
> index 3b3da18feb..c65959f133 100644
> --- a/tests/fate/vpx.mak
> +++ b/tests/fate/vpx.mak
> @@ -71,10 +71,10 @@ FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) +=
> fate-webm-dash-manifest-represe
>  fate-webm-dash-manifest-representations: CMD = run $(FFMPEG) -nostdin -f
> webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video1.webm -f
> webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video4.webm -c copy -map 0
> -map 1 -f webm_dash_manifest -adaptation_sets "id=0,streams=0,1" -
>
>  FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) +=
> fate-webm-dash-manifest-live
> -fate-webm-dash-manifest-live: CMD = run $(FFMPEG) -nostdin -f
> webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr
> -f webm_dash_manifest -live 1 -i
> $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -f
> webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1"
> -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200
> -minimum_update_period 60 -debug_mode 1 -
> +fate-webm-dash-manifest-live: CMD = run $(FFMPEG) -nostdin -f
> webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr
> -f webm_dash_manifest -live 1 -i
> $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -fflags
> +bitexact -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0
> id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000
> -time_shift_buffer_depth 7200 -minimum_update_period 60 -
>
>  FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) +=
> fate-webm-dash-manifest-live-bandwidth
> -fate-webm-dash-manifest-live-bandwidth: CMD = run $(FFMPEG) -nostdin -f
> webm_dash_manifest -live 1 -bandwidth 100 -i
> $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1
> -bandwidth 200 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map
> 0 -map 1 -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0
> id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000
> -time_shift_buffer_depth 7200 -minimum_update_period 60 -debug_mode 1 -
> +fate-webm-dash-manifest-live-bandwidth: CMD = run $(FFMPEG) -nostdin -f
> webm_dash_manifest -live 1 -bandwidth 100 -i
> $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1
> -bandwidth 200 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map
> 0 -map 1 -fflags +bitexact -f webm_dash_manifest -live 1 -adaptation_sets
> "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000
> -time_shift_buffer_depth 7200 -minimum_update_period 60 -
>
>  FATE_VP8-$(call DEMDEC, MATROSKA, VP8) += fate-vp8-2451
>  fate-vp8-2451: CMD = framecrc -flags +bitexact -i
> $(TARGET_SAMPLES)/vp8/RRSF49-short.webm -vsync cfr -an
> --
> 2.20.1
>
> _______________________________________________
> 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".
Andreas Rheinhardt March 24, 2020, 10:19 p.m. UTC | #2
Andreas Rheinhardt:
> The WebM DASH Manifest muxer can write manifests for live streams and
> these contain an entry that depends on the time the manifest is written;
> an AVOption to make the output reproducible has been added for tests.
> But this is unnecessary, as there already is a method for reproducible
> output: The AVFMT_FLAG_BITEXACT-flag of the AVFormatContext. Therefore
> this commit removes the custom option.
> 
> Given that the description of said option contained "private option -
> users should never set this" and that it was not documented in
> muxers.texi, no deprecation period for this option seemed necessary.
> 
> The commands of the FATE-tests for this muxer have been changed to no
> longer use this option.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavformat/webmdashenc.c | 4 +---
>  tests/fate/vpx.mak        | 4 ++--
>  2 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
> index d2f0e0ec4d..0e7bfba34c 100644
> --- a/libavformat/webmdashenc.c
> +++ b/libavformat/webmdashenc.c
> @@ -57,7 +57,6 @@ typedef struct WebMDashMuxContext {
>      char *utc_timing_url;
>      double time_shift_buffer_depth;
>      int minimum_update_period;
> -    int debug_mode;
>  } WebMDashMuxContext;
>  
>  static const char *get_codec_name(int codec_id)
> @@ -114,7 +113,7 @@ static int write_header(AVFormatContext *s)
>          if (!strftime(gmt_iso, 21, "%Y-%m-%dT%H:%M:%SZ", gmt)) {
>              return AVERROR_UNKNOWN;
>          }
> -        if (w->debug_mode) {
> +        if (s->flags & AVFMT_FLAG_BITEXACT) {
>              av_strlcpy(gmt_iso, "", 1);
>          }
>          avio_printf(s->pb, "  availabilityStartTime=\"%s\"\n", gmt_iso);
> @@ -553,7 +552,6 @@ static int webm_dash_manifest_write_packet(AVFormatContext *s, AVPacket *pkt)
>  #define OFFSET(x) offsetof(WebMDashMuxContext, x)
>  static const AVOption options[] = {
>      { "adaptation_sets", "Adaptation sets. Syntax: id=0,streams=0,1,2 id=1,streams=3,4 and so on", OFFSET(adaptation_sets), AV_OPT_TYPE_STRING, { 0 }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
> -    { "debug_mode", "[private option - users should never set this]. Create deterministic output", OFFSET(debug_mode), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
>      { "live", "create a live stream manifest", OFFSET(is_live), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
>      { "chunk_start_index",  "start index of the chunk", OFFSET(chunk_start_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
>      { "chunk_duration_ms", "duration of each chunk (in milliseconds)", OFFSET(chunk_duration), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
> diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
> index 3b3da18feb..c65959f133 100644
> --- a/tests/fate/vpx.mak
> +++ b/tests/fate/vpx.mak
> @@ -71,10 +71,10 @@ FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) += fate-webm-dash-manifest-represe
>  fate-webm-dash-manifest-representations: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video1.webm -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video4.webm -c copy -map 0 -map 1 -f webm_dash_manifest -adaptation_sets "id=0,streams=0,1" -
>  
>  FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) += fate-webm-dash-manifest-live
> -fate-webm-dash-manifest-live: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -debug_mode 1 -
> +fate-webm-dash-manifest-live: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -fflags +bitexact -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -
>  
>  FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) += fate-webm-dash-manifest-live-bandwidth
> -fate-webm-dash-manifest-live-bandwidth: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -live 1 -bandwidth 100 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -bandwidth 200 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -debug_mode 1 -
> +fate-webm-dash-manifest-live-bandwidth: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -live 1 -bandwidth 100 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -bandwidth 200 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -fflags +bitexact -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -
>  
>  FATE_VP8-$(call DEMDEC, MATROSKA, VP8) += fate-vp8-2451
>  fate-vp8-2451: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/vp8/RRSF49-short.webm -vsync cfr -an
> 

If no one objects, I'll push this tomorrow.

- Andreas
Andreas Rheinhardt March 25, 2020, 10:39 p.m. UTC | #3
Andreas Rheinhardt:
> Andreas Rheinhardt:
>> The WebM DASH Manifest muxer can write manifests for live streams and
>> these contain an entry that depends on the time the manifest is written;
>> an AVOption to make the output reproducible has been added for tests.
>> But this is unnecessary, as there already is a method for reproducible
>> output: The AVFMT_FLAG_BITEXACT-flag of the AVFormatContext. Therefore
>> this commit removes the custom option.
>>
>> Given that the description of said option contained "private option -
>> users should never set this" and that it was not documented in
>> muxers.texi, no deprecation period for this option seemed necessary.
>>
>> The commands of the FATE-tests for this muxer have been changed to no
>> longer use this option.
>>
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
>> ---
>>  libavformat/webmdashenc.c | 4 +---
>>  tests/fate/vpx.mak        | 4 ++--
>>  2 files changed, 3 insertions(+), 5 deletions(-)
>>
[...]
>>
> 
> If no one objects, I'll push this tomorrow.
> 
> - Andreas
> 
Applied.

- Andreas
diff mbox series

Patch

diff --git a/libavformat/webmdashenc.c b/libavformat/webmdashenc.c
index d2f0e0ec4d..0e7bfba34c 100644
--- a/libavformat/webmdashenc.c
+++ b/libavformat/webmdashenc.c
@@ -57,7 +57,6 @@  typedef struct WebMDashMuxContext {
     char *utc_timing_url;
     double time_shift_buffer_depth;
     int minimum_update_period;
-    int debug_mode;
 } WebMDashMuxContext;
 
 static const char *get_codec_name(int codec_id)
@@ -114,7 +113,7 @@  static int write_header(AVFormatContext *s)
         if (!strftime(gmt_iso, 21, "%Y-%m-%dT%H:%M:%SZ", gmt)) {
             return AVERROR_UNKNOWN;
         }
-        if (w->debug_mode) {
+        if (s->flags & AVFMT_FLAG_BITEXACT) {
             av_strlcpy(gmt_iso, "", 1);
         }
         avio_printf(s->pb, "  availabilityStartTime=\"%s\"\n", gmt_iso);
@@ -553,7 +552,6 @@  static int webm_dash_manifest_write_packet(AVFormatContext *s, AVPacket *pkt)
 #define OFFSET(x) offsetof(WebMDashMuxContext, x)
 static const AVOption options[] = {
     { "adaptation_sets", "Adaptation sets. Syntax: id=0,streams=0,1,2 id=1,streams=3,4 and so on", OFFSET(adaptation_sets), AV_OPT_TYPE_STRING, { 0 }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
-    { "debug_mode", "[private option - users should never set this]. Create deterministic output", OFFSET(debug_mode), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
     { "live", "create a live stream manifest", OFFSET(is_live), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM },
     { "chunk_start_index",  "start index of the chunk", OFFSET(chunk_start_index), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
     { "chunk_duration_ms", "duration of each chunk (in milliseconds)", OFFSET(chunk_duration), AV_OPT_TYPE_INT, {.i64 = 1000}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
diff --git a/tests/fate/vpx.mak b/tests/fate/vpx.mak
index 3b3da18feb..c65959f133 100644
--- a/tests/fate/vpx.mak
+++ b/tests/fate/vpx.mak
@@ -71,10 +71,10 @@  FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) += fate-webm-dash-manifest-represe
 fate-webm-dash-manifest-representations: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video1.webm -f webm_dash_manifest -i $(TARGET_SAMPLES)/vp8/dash_video4.webm -c copy -map 0 -map 1 -f webm_dash_manifest -adaptation_sets "id=0,streams=0,1" -
 
 FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) += fate-webm-dash-manifest-live
-fate-webm-dash-manifest-live: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -debug_mode 1 -
+fate-webm-dash-manifest-live: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -fflags +bitexact -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -
 
 FATE_VP8-$(CONFIG_WEBM_DASH_MANIFEST_DEMUXER) += fate-webm-dash-manifest-live-bandwidth
-fate-webm-dash-manifest-live-bandwidth: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -live 1 -bandwidth 100 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -bandwidth 200 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -debug_mode 1 -
+fate-webm-dash-manifest-live-bandwidth: CMD = run $(FFMPEG) -nostdin -f webm_dash_manifest -live 1 -bandwidth 100 -i $(TARGET_SAMPLES)/vp8/dash_live_video_360.hdr -f webm_dash_manifest -live 1 -bandwidth 200 -i $(TARGET_SAMPLES)/vp8/dash_live_audio_171.hdr -c copy -map 0 -map 1 -fflags +bitexact -f webm_dash_manifest -live 1 -adaptation_sets "id=0,streams=0 id=1,streams=1" -chunk_start_index 1 -chunk_duration_ms 5000 -time_shift_buffer_depth 7200 -minimum_update_period 60 -
 
 FATE_VP8-$(call DEMDEC, MATROSKA, VP8) += fate-vp8-2451
 fate-vp8-2451: CMD = framecrc -flags +bitexact -i $(TARGET_SAMPLES)/vp8/RRSF49-short.webm -vsync cfr -an