Opened 22 months ago

Last modified 21 months ago

#5881 open enhancement

Allow writing subtitle only hls streams

Reported by: cbass Owned by:
Priority: normal Component: avformat
Version: unspecified Keywords: hls webvtt
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: yes



I'm unable to mux dvb_teletext as webvtt hls (.m3u8).
I always obtain the following error

(incorrect codec parameters ?): Invalid argument

It looks and issue of the hls mux as .webvtt output works well

How to reproduce:
To reproduce you DVB MPTS or SPTS stresm that include dvb_teletext pid and your ffmpeg must be build libvzbi

--Doesn't works---

command line

/usr/local/bin/ffmpeg -v 9 -loglevel 99 -txt_format text -txt_page 801 -txt_duration 4000 -i "udp://@"       -map 0:p:2000:3 -c:s:0 webvtt -f hls -hls_time 10 -hls_list_size 180 -hls_flags delete_segments -hls_segment_filename /mnt/sub0_%05d.vtt /mnt/sub0.m3u8


ffmpeg version N-81896-ga6bce3c Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-4)
  configuration: --prefix=/home/scramatte/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/home/scramatte/ffmpeg_build/include --extra-ldflags=-L/home/scramatte/ffmpeg_build/lib --bindir=/home/scramatte/bin --enable-gpl --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libmfx --enable-libzvbi --enable-nonfree
  libavutil      55. 32.100 / 55. 32.100
  libavcodec     57. 60.101 / 57. 60.101
  libavformat    57. 51.102 / 57. 51.102
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 63.100 /  6. 63.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  2.100 /  2.  2.100
  libpostproc    54.  0.100 / 54.  0.100
Successfully opened the file.
Parsing a group of options: output file /mnt/sub0.m3u8.
Applying option map (set input stream mapping) with argument 0:p:29815:3.
Applying option c:s:0 (codec name) with argument webvtt.
Applying option f (force format) with argument hls.
Successfully parsed a group of options.
Opening an output file: /mnt/sub0.m3u8.
Successfully opened the file.
[libzvbi_teletextdec @ 0x2f35da0] page filter: 801
[file @ 0x2f3d1a0] Setting default whitelist 'file,crypto'
[file @ 0x2f30e60] Setting default whitelist 'file,crypto'
[mpegts @ 0x334a940] No streams to mux were specified
Output #0, hls, to '/mnt/sub0.m3u8':
    encoder         : Lavf57.51.102
    Stream #0:0(spa,eng), 0, 1/1000: Subtitle: webvtt, 492x250
      encoder         : Lavc57.60.101 webvtt
Stream mapping:
  Stream #0:26 -> #0:0 (dvb_teletext (libzvbi_teletextdec) -> webvtt (native))
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
[AVIOContext @ 0x2eef020] Statistics: 16653040 bytes read, 0 seeks

-- Works --
command line

/usr/local/bin/ffmpeg -txt_format text -txt_page 801 -txt_duration 4000 -i "udp://@"       -map 0:p:29815:3 -c:s:0 webvtt -f webvtt sub.webvtt


File 'sub.webvtt' already exists. Overwrite ? [y/N] y
Output #0, webvtt, to 'sub.webvtt':
    encoder         : Lavf57.51.102
    Stream #0:0(spa,eng): Subtitle: webvtt
      encoder         : Lavc57.60.101 webvtt
Stream mapping:
  Stream #0:21 -> #0:0 (dvb_teletext (libzvbi_teletextdec) -> webvtt (native))
Press [q] to stop, [?] for help
size=       0kB time=00:00:02.96 bitrate=   0.3kbits/s speed=1.17x    
video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 109.259262%

Change History (3)

comment:1 Changed 22 months ago by cehoyos

To make this a valid ticket, dump your input stream to a file (with mplayer -dumpstream or similar, do not use FFmpeg) and provide your command line using the produced file together with the complete, uncut console output and the input file.

comment:2 Changed 21 months ago by cus

  • Component changed from undetermined to avformat
  • Status changed from new to open
  • Summary changed from unable to mux dvb_teletext as webvtt hls : (incorrect codec parameters ?): Invalid argument to Allow writing subtitle only hls streams
  • Type changed from defect to enhancement

I don't think ffmpeg is capable of writing a HLS stream without at least an audio component. Until then, you can workaround this by writing an audio stream in addition to the subtitle. Also you might want to use -fix_sub_duration flag if converting from dvb teletext.

comment:3 Changed 21 months ago by cus

  • Analyzed by developer set
  • Reproduced by developer set
Note: See TracTickets for help on using tickets.