[FFmpeg-user] mixed MPEG-DASH manifest

Wouter Verhelst w at uter.be
Fri Jul 21 16:17:45 EEST 2023


Hi,

I'm trying to create an MPEG-DASH manifest that has multiple codecs in
the file. Based on the documentation and some pre-existing
configuration, I did this:

ffmpeg -i <input>.mp4 -map 0 -map 0 -map 0 -map 0 -map 0 -map 0 -map 0 -crf 23
  -c:v:0 libsvtav1 -preset:v:0 8
  -c:v:1 libsvtav1 -preset:v:1 8 -s:v:1 640x360
  -c:v:2 libsvtav1 -preset:v:2 8 -s:v:2 320x180
  -c:v:3 libx264 -b:v:3 1024k -preset:v:3 veryfast -filter:v:3 'scale=900:trunc(ow/a/2)*2'
  -c:v:4 libx264 -b:v:4 768k -preset:v:4 veryfast -filter:v:4 'scale=720:trunc(ow/a/2)*2'
  -c:v:5 libx264 -b:v:5 256k -preset:v:5 veryfast -filter:v:5 'scale=480:trunc(ow/a/2)*2'
  -c:v:6 copy
  -c:a:0 aac -b:a:0 128k
  -c:a:1 aac -b:a:1 64k
  -c:a:2 libopus -b:a:2 128k
  -c:a:3 libopus -b:a:3 64k
  -adaptation_sets "id=0,streams=v id=1,streams=a"
  -f dash <output>.mpd

The idea of the above being that we create an MPEG-DASH manifest with
MPEG-4 and AV1 streams for various resolutions, as well as AAC and Opus
audio streams of multiple bit rates.

This "works", in that I don't get error messages, and some output is
produced. The output can be consumed by mpv (and I can select any of the
streams, and I get non-garbage output); but if I try to play the output
using a video player that is not ffmpeg-based, then things don't go so
well.

VLC only sees one audio stream and one video stream, and it is one of
the ones at very low resolution.

dash.js fails to load the stream. When I try, the browser console says:

This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
test.html
unreachable code after return statement
MediaController.js:419:12
GET
http://localhost/favicon.ico
[HTTP/1.1 404 Not Found 0ms]

Media resource blob:http://localhost/c5b07a95-79c1-4d69-ba54-31bd2a397f5c could not be decoded. test.html
[277][SourceBufferSink][video] getAllBufferRanges exception: An attempt was made to use an object that is not, or is no longer, usable Debug.js:169:25
[279][SourceBufferSink][audio] getAllBufferRanges exception: An attempt was made to use an object that is not, or is no longer, usable Debug.js:169:25
[280][VideoModel] Caught pending play exception - continuing (NotSupportedError: The media resource indicated by the src attribute or assigned media provider object was not suitable.) Debug.js:169:25
This error message will be blank when privacy.resistFingerprinting = true.  If it is really necessary, please add it to the whitelist in MediaError::GetMessage: NS_ERROR_FAILURE (0x80004005) - Invalid element id of length 8 StreamController.js:1389:13
This error message will be blank when privacy.resistFingerprinting = true.  If it is really necessary, please add it to the whitelist in MediaError::GetMessage: NS_ERROR_FAILURE (0x80004005) - Invalid element id of length 8 StreamController.js:1390:12
[285][StreamController] Video Element Error: MEDIA_ERR_SRC_NOT_SUPPORTED (NS_ERROR_FAILURE (0x80004005) - Invalid element id of length 8) Debug.js:169:25
[285][StreamController] [object MediaError] Debug.js:169:25
Media resource blob:http://localhost/c5b07a95-79c1-4d69-ba54-31bd2a397f5c could not be decoded, error: Error Code: NS_ERROR_FAILURE (0x80004005)
Details: Invalid element id of length 8 test.html

Am I trying the right thing here? Should I attempt something else
instead? Is it even supported to create a DASH manifest for multiple
codecs at once?

Thanks in advance,

-- 
     w at uter.{be,co.za}
wouter@{grep.be,fosdem.org,debian.org}

I will have a Tin-Actinium-Potassium mixture, thanks.


More information about the ffmpeg-user mailing list