Opened 7 years ago

Last modified 7 years ago

#5881 open enhancement

Allow writing subtitle only hls streams

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

Description

Hi,

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://@239.180.15.15:2000?localaddr=192.168.0.201&fifo_size=1000000&overrun_nonfatal=1"       -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

output

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':
  Metadata:
    encoder         : Lavf57.51.102
    Stream #0:0(spa,eng), 0, 1/1000: Subtitle: webvtt, 492x250
    Metadata:
      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://@239.180.15.15:2000?localaddr=192.168.0.201&fifo_size=1000000&overrun_nonfatal=1"       -map 0:p:29815:3 -c:s:0 webvtt -f webvtt sub.webvtt

output

File 'sub.webvtt' already exists. Overwrite ? [y/N] y
Output #0, webvtt, to 'sub.webvtt':
  Metadata:
    encoder         : Lavf57.51.102
    Stream #0:0(spa,eng): Subtitle: webvtt
    Metadata:
      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 by Carl Eugen Hoyos, 7 years ago

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 by Marton Balint, 7 years ago

Component: undeterminedavformat
Status: newopen
Summary: unable to mux dvb_teletext as webvtt hls : (incorrect codec parameters ?): Invalid argumentAllow writing subtitle only hls streams
Type: defectenhancement

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 by Marton Balint, 7 years ago

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