Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#9252 closed defect (fixed)

[dash muxer] Unplayable (empty) HLS, audio-only, master playlist

Reported by: pszemus Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: DASH HLS
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

When using DASH muxer to create DASH and HLS streams from an audio-only (e.g. mp3) file, consuming only one encoding process, the HLS stream is unplayable (DASH stream works OK).

While writing HLS master playlist, DASH muxer treats all audio streams as an alternative HLS audio tracks for video tracks, and when there's no video tracks the master HLS playlist becomes empty:

#EXTM3U
#EXT-X-VERSION:7
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_A1",NAME="audio_0",DEFAULT=YES,URI="media_0.m3u8"

(no chunklists)

How to reproduce:

$ffmpeg -i https://filesamples.com/samples/audio/mp3/sample3.mp3 -c:a aac -use_timeline 1 -use_template 1 -adaptation_sets "id=0,streams=a" -hls_playlist 1 -f dash /tmp/dash/manifest.mpd
ffmpeg version 4.4 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 11 (GCC)
  configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld ' --extra-cflags=' -I/usr/include/rav1e' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-frei0r --enable-gcrypt --enable-gnutls --enable-ladspa --enable-libaom --enable-libdav1d --enable-libass --enable-libbluray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-nvenc --enable-openal --enable-opencl --enable-opengl --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librav1e --enable-libsmbclient --enable-version3 --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-version3 --enable-vapoursynth --enable-libvpx --enable-vulkan --enable-libglslang --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enable-libzvbi --enable-lv2 --enable-avfilter --enable-avresample --enable-libmodplug --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-lto --enable-libmfx --enable-runtime-cpudetect
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100
[mp3 @ 0x55599eb0acc0] invalid concatenated file detected - using bitrate for duration
Input #0, mp3, from 'https://filesamples.com/samples/audio/mp3/sample3.mp3':
  Metadata:
    encoder         : Lavf57.83.100
  Duration: N/A, start: 0.025057, bitrate: 128 kb/s
  Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc57.10
Stream mapping:
  Stream #0:0 -> #0:0 (mp3 (mp3float) -> aac (native))
Press [q] to stop, [?] for help
[dash @ 0x55599f110500] Opening '/tmp/dash/init-stream0.m4s' for writing
Output #0, dash, to '/tmp/dash/manifest.mpd':
  Metadata:
    encoder         : Lavf58.76.100
  Stream #0:0: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.134.100 aac
[dash @ 0x55599f110500] Opening '/tmp/dash/chunk-stream0-00001.m4s.tmp' for writing
[dash @ 0x55599f110500] Opening '/tmp/dash/manifest.mpd.tmp' for writing
[dash @ 0x55599f110500] Opening '/tmp/dash/media_0.m3u8.tmp' for writing
[dash @ 0x55599f110500] Opening '/tmp/dash/master.m3u8.tmp' for writing
[...]
[dash @ 0x55599f110500] Opening '/tmp/dash/chunk-stream0-00022.m4s.tmp' for writing
[dash @ 0x55599f110500] Opening '/tmp/dash/manifest.mpd.tmp' for writing
[dash @ 0x55599f110500] Opening '/tmp/dash/media_0.m3u8.tmp' for writing
size=N/A time=00:01:45.79 bitrate=N/A speed= 114x    
video:0kB audio:1667kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
[aac @ 0x55599ebce0c0] Qavg: 207.240


$ cat /tmp/dash/master.m3u8 
#EXTM3U
#EXT-X-VERSION:7
#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID="group_A1",NAME="audio_0",DEFAULT=YES,URI="media_0.m3u8"


$ mpv /tmp/dash/master.m3u8 
Empty playlist!

Exiting... (End of file)

Change History (6)

comment:1 by Carl Eugen Hoyos, 3 years ago

Please confirm that the issue is reproducible with current FFmpeg git head to make this a valid ticket.

in reply to:  2 comment:3 by Balling, 3 years ago

Replying to pszemus:

Yes it is. I've even proposed a patch to fix this: https://patchwork.ffmpeg.org/project/ffmpeg/patch/b6c1b15b-1297-b59a-9a1b-c6d3fb24e070@gmail.com/

Yet it did not even apply. You can use this one thingy to send patches with git send-email, except it will send gmail through oath2, that is what I do. https://github.com/google/gmail-oauth2-tools/tree/master/go/sendgmail

The instruction is outdated though, you will have to publish an app in Google Cloud console.

Last edited 3 years ago by Balling (previous) (diff)

comment:4 by Carl Eugen Hoyos, 3 years ago

Please remove the re-indentation from your patch to make reviews easier.

in reply to:  4 comment:5 by pszemus, 3 years ago

Replying to Carl Eugen Hoyos:

Please remove the re-indentation from your patch to make reviews easier.

I've prepared a patch that ignores indentation changes and sent it with git send-email.
I hope now you'll be able to review it.

comment:6 by Balling, 3 years ago

Resolution: fixed
Status: newclosed
Last edited 3 years ago by Balling (previous) (diff)
Note: See TracTickets for help on using tickets.