[FFmpeg-user] generating DASH manifest file

Janis dvml at abj.lv
Sun Jan 10 21:17:48 EET 2021


Hello everyone,

Sometimes I have a problem with generating DASH manifest file, sometimes 
i don't.

I would like to understand why is that so and what could i do about it, 
because
i am using the same command in both cases.


On error i get:
..
[webm_dash_manifest @ 0000000000495700] Error parsing Cues
video.webm: Operation not permitted


Which is not very helpful and informative in itself.

Trimmed down command still having the same error:
./ffmpeg.exe -f webm_dash_manifest -i "video_notworking.webm" -c copy 
-map 0 -f webm_dash_manifest -adaptation_sets "id=0,streams=0" 
test_manifest.mpd


I am not adept in using ffmpeg, so maybe error is due to my misuse of 
command flags,
but of this command usage I got inspired by article at:
https://developer.mozilla.org/en-US/docs/Web/Media/DASH_Adaptive_Streaming_for_HTML_5_Video

The video file works on it's own with ffplay and there are no errors
with ffprobe. Video source file is not generated by ffmpeg.

Video file can be converted by ffmpeg like so:
./ffmpeg.exe -i video.webm -f webm -dash 1 video_converted.webm

And then the DASH manifest generation command works.

I would like to avoid the conversion step if possible, because it is
extra step to be done and takes time, especially if video is lengthy
and high resolution.

I don't know what "Cues" are, but is there some way to get more info on 
why exactly parsing failed?
E.g. How to know if there is some missing information in source file or 
format is unsupported/malformed?
Maybe file is corrupt or something?

I will copy full outputs below message - for not working case and for 
working case.

For not working case ffprobe's line
"Duration: N/A, start: 0.000000, bitrate: N/A" seems fishy, because in 
working case
it has values, e.g. "Duration: 00:09:52.33, start: 0.000000, bitrate: 
3293 kb/s",
the same is for converted.

Is there a "fast-way" conversion available that just adds duration?


Then what seems weird is that in non working case Stream contains chunk:
"yuv420p(tv, bt709/unknown/unknown)"
Where working case without -f, contains "yuv420p(tv, bt709)"
with -f "none(tv, bt709)" and still works. For converted "yuv420p(tv)"

How should i interpret those values "bt709/unknown/unknown" in parentheses?

What are your thoughts? Suggestions?

Thank you!

Full log outputs for:

Not working:
$ ./ffmpeg.exe -f webm_dash_manifest -i "video_notworking.webm" -c copy 
-map 0 -f webm_dash_manifest -adaptation_sets "id=0,streams=0" 
test_manifest.mpd -loglevel trace
ffmpeg version 4.3.1-2021-01-01-full_build-www.gyan.dev Copyright (c) 
2000-2021 the FFmpeg developers
   built with gcc 10.2.0 (Rev5, Built by MSYS2 project)
   configuration: --enable-gpl --enable-version3 --enable-static 
--disable-w32threads --disable-autodetect --enable-fontconfig 
--enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp 
--enable-lzma --enable-libsnappy --enable-zlib --enable-libsrt 
--enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray 
--enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi 
--enable-librav1e --enable-libwebp --enable-libx264 --enable-libx265 
--enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx 
--enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi 
--enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf 
--enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec 
--enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx 
--enable-libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt 
--enable-libopencore-amrwb --enable-libmp3lame --enable-libshine 
--enable-libtheora --enable-libtwolame --enable-libvo-amrwbenc 
--enable-libilbc --enable-libgsm --enable-libopencore-amrnb 
--enable-libopus --enable-libspeex --enable-libvorbis --enable-ladspa 
--enable-libbs2b --enable-libflite --enable-libmysofa 
--enable-librubberband --enable-libsoxr --enable-chromaprint
   libavutil      56. 51.100 / 56. 51.100
   libavcodec     58. 91.100 / 58. 91.100
   libavformat    58. 45.100 / 58. 45.100
   libavdevice    58. 10.100 / 58. 10.100
   libavfilter     7. 85.100 /  7. 85.100
   libswscale      5.  7.100 /  5.  7.100
   libswresample   3.  7.100 /  3.  7.100
   libpostproc    55.  7.100 / 55.  7.100
Splitting the commandline.
Reading option '-f' ... matched as option 'f' (force format) with 
argument 'webm_dash_manifest'.
Reading option '-i' ... matched as input url with argument 
'video_notworking.webm'.
Reading option '-c' ... matched as option 'c' (codec name) with argument 
'copy'.
Reading option '-map' ... matched as option 'map' (set input stream 
mapping) with argument '0'.
Reading option '-f' ... matched as option 'f' (force format) with 
argument 'webm_dash_manifest'.
Reading option '-adaptation_sets' ... matched as AVOption 
'adaptation_sets' with argument 'id=0,streams=0'.
Reading option 'test_manifest.mpd' ... matched as output url.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging 
level) with argument 'trace'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument trace.
Successfully parsed a group of options.
Parsing a group of options: input url video_notworking.webm.
Applying option f (force format) with argument webm_dash_manifest.
Successfully parsed a group of options.
Opening an input file: video_notworking.webm.
[webm_dash_manifest @ 0000000000474980] Opening 'video_notworking.webm' 
for reading
[file @ 0000000000476100] Setting default whitelist 'file,crypto,data'
st:0 removing common factor 1000000 from timebase
[webm_dash_manifest @ 0000000000474980] Error parsing Cues
[AVIOContext @ 000000000047e380] Statistics: 32768 bytes read, 0 seeks
video_notworking.webm: Operation not permitted



Probe for not working video case:
$ ./ffprobe.exe -hide_banner -i "video_notworking.webm" -loglevel trace
[NULL @ 0000000000567e40] Opening 'video_notworking.webm' for reading
[file @ 00000000005687c0] Setting default whitelist 'file,crypto,data'
Probing h263 score:25 size:2048
Probing matroska,webm score:100 size:2048
Probing mp3 score:1 size:2048
[matroska,webm @ 0000000000567e40] Format matroska,webm probed with 
size=2048 and score=100
st:0 removing common factor 1000000 from timebase
[matroska,webm @ 0000000000567e40] Before avformat_find_stream_info() 
pos: 705 bytes read:32768 seeks:0 nb_streams:1
[vp9 @ 000000000057c780] Format yuv420p chosen by get_format().
[matroska,webm @ 0000000000567e40] All info found
[matroska,webm @ 0000000000567e40] stream 0: start_time: 0 duration: NOPTS
[matroska,webm @ 0000000000567e40] format: start_time: 0 duration: NOPTS 
(estimate from bit rate) bitrate=0 kb/s
[matroska,webm @ 0000000000567e40] After avformat_find_stream_info() 
pos: 3210 bytes read:32768 seeks:0 frames:1
Input #0, matroska,webm, from 'video_notworking.webm':
   Metadata:
     encoder         : google/video-file
     http://youtube.com/streaming/otf/durations/112015: Segment-Count: 87
                     : Segment-Durations-Ms: 
5339,5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),5338,5339(r=1),533
                     :
                     :
   Duration: N/A, start: 0.000000, bitrate: N/A
     Stream #0:0(eng), 1, 1/1000: Video: vp9 (Profile 0), 1 reference 
frame, yuv420p(tv, bt709/unknown/unknown), 1920x1080, 0/1, SAR 1:1 DAR 
16:9, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
[AVIOContext @ 0000000000572a80] Statistics: 32768 bytes read, 0 seeks



Probe with -f for not working case:
$ ./ffprobe.exe -hide_banner -f webm_dash_manifest -i 
"video_notworking.webm" -loglevel trace
[webm_dash_manifest @ 00000000006460c0] Opening 'video_notworking.webm' 
for reading
[file @ 0000000000646a00] Setting default whitelist 'file,crypto,data'
st:0 removing common factor 1000000 from timebase
[webm_dash_manifest @ 00000000006460c0] Error parsing Cues
[AVIOContext @ 0000000000650cc0] Statistics: 32768 bytes read, 0 seeks
video_notworking.webm: Operation not permitted



Probe for working case:
$ ./ffprobe.exe -hide_banner -i "video_working.webm" -loglevel trace
[NULL @ 0000000000577e40] Opening 'video_working.webm' for reading
[file @ 00000000005787c0] Setting default whitelist 'file,crypto,data'
Probing matroska,webm score:100 size:2048
[matroska,webm @ 0000000000577e40] Format matroska,webm probed with 
size=2048 and score=100
st:0 removing common factor 1000000 from timebase
[matroska,webm @ 0000000000577e40] Before avformat_find_stream_info() 
pos: 2352 bytes read:32768 seeks:0 nb_streams:1
[vp9 @ 000000000057f640] Format yuv420p chosen by get_format().
[matroska,webm @ 0000000000577e40] All info found
[matroska,webm @ 0000000000577e40] stream 0: start_time: 0 duration: NOPTS
[matroska,webm @ 0000000000577e40] format: start_time: 0 duration: 
592.325 (estimate from stream) bitrate=3293 kb/s
[matroska,webm @ 0000000000577e40] After avformat_find_stream_info() 
pos: 17475 bytes read:32768 seeks:0 frames:1
Input #0, matroska,webm, from 'video_working.webm':
   Metadata:
     encoder         : google/video-file
   Duration: 00:09:52.33, start: 0.000000, bitrate: 3293 kb/s
     Stream #0:0(eng), 1, 1/1000: Video: vp9 (Profile 0), 1 reference 
frame, yuv420p(tv, bt709), 3840x2160, 0/1, SAR 1:1 DAR 16:9, 29.97 fps, 
29.97 tbr, 1k tbn, 1k tbc (default)
[AVIOContext @ 0000000000582a80] Statistics: 32768 bytes read, 0 seeks



Probe for working with -f flag.
$ ./ffprobe.exe -hide_banner -f webm_dash_manifest -i 
"video_working.webm" -loglevel trace
[webm_dash_manifest @ 00000000004d6080] Opening 'video_working.webm' for 
reading
[file @ 00000000004d6a00] Setting default whitelist 'file,crypto,data'
st:0 removing common factor 1000000 from timebase
[webm_dash_manifest @ 00000000004d6080] File ended prematurely at pos. 
243864208 (0xe891290)
[webm_dash_manifest @ 00000000004d6080] Before 
avformat_find_stream_info() pos: 2352 bytes read:27630115 seeks:156 
nb_streams:1
[webm_dash_manifest @ 00000000004d6080] stream 0: start_time: NOPTS 
duration: 592.325
[webm_dash_manifest @ 00000000004d6080] format: start_time: NOPTS 
duration: 592.325 (estimate from stream) bitrate=3293 kb/s
[webm_dash_manifest @ 00000000004d6080] Could not find codec parameters 
for stream 0 (Video: vp9, 1 reference frame, none(tv, bt709), 3840x2160, 
1/1000): unspecified pixel format
Consider increasing the value for the 'analyzeduration' and 'probesize' 
options
[webm_dash_manifest @ 00000000004d6080] After 
avformat_find_stream_info() pos: 2352 bytes read:27630115 seeks:156 frames:0
Input #0, webm_dash_manifest, from 'video_working.webm':
   Metadata:
     encoder         : google/video-file
   Duration: 00:09:52.33, bitrate: 3293 kb/s
     Stream #0:0(eng), 0, 1/1000: Video: vp9, 1 reference frame, 
none(tv, bt709), 3840x2160, 0/1, SAR 1:1 DAR 16:9, 29.97 fps, 29.97 tbr, 
1k tbn, 1k tbc (default)
     Metadata:
       webm_dash_manifest_duration: 592325
       webm_dash_manifest_cues_end: 2347
       webm_dash_manifest_file_name: video_working.webm
       webm_dash_manifest_track_number: 1
       webm_dash_manifest_cues_start: 220
       webm_dash_manifest_initialization_range: 219
       webm_dash_manifest_bandwidth: 11988200
       webm_dash_manifest_cluster_keyframe: 1
       webm_dash_manifest_cue_timestamps: 
0,5005,10010,15015,17084,20020,25025,30030,35035,40040,45045,50384,55389,60394,65399,70404,75409,80414,81982,85419,90424,95429,97598,100434,105439,110444,115449,120454,125459,129263,130464,135469,140474,144711,149716,150250,154721,159726,164731,169736,174
[AVIOContext @ 00000000004e0cc0] Statistics: 27630115 bytes read, 156 seeks




More information about the ffmpeg-user mailing list