[FFmpeg-trac] #9190(undetermined:new): dashenc creates web-unplayable files with copied opus streams

FFmpeg trac at avcodec.org
Thu Apr 15 05:14:06 EEST 2021


#9190: dashenc creates web-unplayable files with copied opus streams
-------------------------------------+-------------------------------------
             Reporter:  aphysically  |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:  git-
  undetermined                       |  master
             Keywords:  dash         |               Blocked By:
  dashenc                            |
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
 When copying certain streams (like opus) from an input to dashenc, dashenc
 makes web-unplayable streams that give mp4 metadata parsing failures in
 Firefox/web browsers. This does not occur if the audio stream is
 reencoded.

 ffmpeg master built in 2021/04/14
 Begin by building a file to use as input for the dash encode; I'm using an
 mpegts to simulate a SRT-transmitted input.
 `ffmpeg -report -f lavfi -i
 testsrc=duration=60:size=1920x1080:rate=30,format=yuv420p -f lavfi -i
 sine=frequency=440:duration=60:sample_rate=44100:b=4 -pix_fmt yuv420p -c:v
 libx264 -b:v 1000k -g:v 60 -keyint_min:v 60 -sc_threshold:v 0 -profile:v
 high -preset veryfast -c:a libopus -b:a 128k -y -f mpegts "badmpeg.ts"`
 Log of this command is attached as badmpeg.log

 I created the subdirectories `dash/dashbad` and `dash/dashgood` to encode
 with dashenc a stream where the audio is copied and reencoded
 respectively. The one where audio is copied will fail to playback in
 Firefox.

 In the `dash/dashbad` directory, run:
 `ffmpeg -report -vtag "avc1" -re -i ../../badmpeg.ts -c:v:0 copy -c:a:0
 copy -b:v:0 1000k -b:a:0 128k -map 0:v -map 0:a -y -f dash -seg_duration
 "2" -dash_segment_type mp4 -use_template 1 -use_timeline 0 -format_options
 "movflags=+cmaf" -adaptation_sets "id=0,streams=v id=1,streams=a"
 "stream.mpd"`
 In the `dash/dashgood` directory, run:
 `ffmpeg -report -vtag "avc1" -re -i ../../badmpeg.ts -c:v:0 copy -c:a:0
 libopus -b:a:0 64k -b:v:0 1000k -map 0:v -map 0:a -y -f dash -seg_duration
 "2" -dash_segment_type mp4 -use_template 1 -use_timeline 0 -format_options
 "movflags=+cmaf" -adaptation_sets "id=0,streams=v id=1,streams=a"
 "stream.mpd"`

 The only difference for these two dashenc runs is that in the "dashgood"
 one the opus input is re-encoded. The logs of these two runs are attached
 as dashgood.log and dashbad.log.

 If you try to play the stream.mpd in the dashgood run where the opus audio
 was reencoded, it will play fine with dash.js in a browser. If you try to
 play the dashbad run it will fail with an mp4 parsing error e.g. the
 following in Firefox 87.0

 {{{
 MEDIA_ERR_SRC_NOT_SUPPORTED (NS_ERROR_DOM_MEDIA_METADATA_ERR (0x806e0006)
 - virtual RefPtr<MP4Demuxer::InitPromise> mozilla::MP4Demuxer::Init():
 Parse MP4 metadata failed)
 }}}

 I don't have any issues with ffplay or mpv on either file.

 I am hosting the streams on my website so you can reproduce the failure
 with the dash.js reference player at
 [https://reference.dashif.org/dash.js/v3.2.2/samples/dash-if-reference-
 player/index.html].

 You may try playing
 [https://stream.gably.net/images/dash/dashgood/stream.mpd] and
 [https://stream.gably.net/images/dash/dashbad/stream.mpd] with the
 reference player for the working (transcoded audio) and nonworking (copied
 audio) streams respectively.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/9190>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list