Opened 5 years ago
Closed 4 years ago
#8754 closed defect (fixed)
Dash manifest: Conflicting stream par values in Adaptation Set
Reported by: | cars10 | Owned by: | |
---|---|---|---|
Priority: | minor | Component: | avformat |
Version: | git-master | Keywords: | dash |
Cc: | david.rivron@kelis.fr | Blocked By: | |
Blocking: | Reproduced by developer: | no | |
Analyzed by developer: | no |
Description
Summary of the bug:
We use ffmpeg to generate dash and hls manifest from four different inputs:
- audio-only m4a file
- video-only 480p mp4 file
- video-only 720p mp4 file
- video-only 1080p mp4 file
This works perfectly with ffmpeg 4.2.x but fails on 4.3 with "Conflicting stream par values in Adaptation Set".
How to reproduce:
We use the following command to create the manifests and stream files:
% ffmpeg -y -i audio_only.m4a -i 480p_video_only.mp4 -i 720p_video_only.mp4 -i 1080p_video_only.mp4 -c copy -map 0:a:0 -map 1:v:0 -map 2:v:0 -map 3:v:0 -f dash -single_file 1 -single_file_name stream-\$RepresentationID\$.m4s -hls_playlist 1 -adaptation_sets "id=0,streams=0 id=1,streams=1,2,3" manifest.mpd ffmpeg version 4.3-static https://johnvansickle.com/ffmpeg/ Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-libgme --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d --enable-libxvid --enable-libzvbi --enable-libzimg 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 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'audio_only.m4a': Metadata: major_brand : M4A minor_version : 512 compatible_brands: M4A isomiso2 encoder : Lavf58.45.100 Duration: 00:36:38.36, start: 0.000000, bitrate: 195 kb/s Stream #0:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 194 kb/s (default) Metadata: handler_name : L-SMASH Audio Handler Input #1, mov,mp4,m4a,3gp,3g2,mj2, from '480p_video_only.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.45.100 Duration: 00:36:38.32, start: 0.000000, bitrate: 338 kb/s Stream #1:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 852x480, 335 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : L-SMASH Video Handler Input #2, mov,mp4,m4a,3gp,3g2,mj2, from '720p_video_only.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.45.100 Duration: 00:36:38.32, start: 0.000000, bitrate: 1365 kb/s Stream #2:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1280x720, 1362 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : L-SMASH Video Handler Input #3, mov,mp4,m4a,3gp,3g2,mj2, from '1080p_video_only.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf58.45.100 Duration: 00:36:38.32, start: 0.000000, bitrate: 5131 kb/s Stream #3:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1920x1080, 5129 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default) Metadata: handler_name : L-SMASH Video Handler [dash @ 0x6c94cc0] Conflicting stream par values in Adaptation Set 2 Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Stream mapping: Stream #0:0 -> #0:0 (copy) Stream #1:0 -> #0:1 (copy) Stream #2:0 -> #0:2 (copy) Stream #3:0 -> #0:3 (copy) Last message repeated 1 times
We tried to change the adaptation sets to "id=0,streams=a id=1,streams=v" but that did not help either. Neither the error message nor the source code helped us in understanding what is wrong, so we believe this could be a bug.
Change History (6)
comment:1 by , 5 years ago
Version: | unspecified → git-master |
---|
comment:2 by , 5 years ago
comment:3 by , 5 years ago
Thanks, we will change the resolution of our videos to have the same aspect ratio.
A different error message (basically your explanation) for this would be awesome, i think that most people don't know what "conflicting stream par values" means :)
comment:4 by , 5 years ago
Component: | undetermined → avformat |
---|---|
Keywords: | dash added |
Priority: | normal → minor |
Status: | new → open |
Given that "par" was often used instead of SAR in FFmpeg (pixel aspect ratio) and that FFmpeg calls the value DAR, there is definitely room for improvement.
comment:5 by , 5 years ago
Cc: | added |
---|
comment:6 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fixed by Chris Miceli in 41366522899f209d116d663ebedf00e3282e7bb2
"Conflicting stream par values" means there are two or more video streams in the same Adaptation Set with differing display aspect ratio (par). The @par value in the Adaptation Set must apply to all streams.
In your case, the 852x480 stream with a 1:1 sample aspect ratio (sar) has a 71:40 par, which is different than the 1:1 sar 1280x720 and 1920x1080 streams, both of which are 16:9 par, so it can't be in the same Adaptation Set.
A workaround when using 1:1 sar streams would be making the 480p stream have a resolution of 832x468.