[FFmpeg-user] ffserver - hls/segment options in ffserver.conf?
Ricardo Kleemann
ricardo at americasnet.com
Mon May 18 06:03:18 CEST 2015
Hi,
Anyone know if any of the "segment" (or hls) options used with ffmpeg can
be set for a Stream in ffserver.conf?
For example, hls_segment_filename, hls_time, etc...
I have a working hls file set of commands for ffmpeg but wanted to be able
to have ffserver produce a stream from that.
I've tried feeding ffserver using the -override_ffserver option in an
attempt to have the ffmpeg options passed over to the ffserver stream but
that's not working.
I tried setting up ffserver.conf with the following stream:
<Stream live.m3u8>
Feed feed1.ffm
Format hls
</Stream>
And the command to feed ffserver is
$ ffmpeg -re -i ~/video/sample.mp4 -c copy -flags +global_header -bsf:v
h264_mp4toannexb -hls_time 10 -hls_list_size 60 -hls_wrap 60
-hls_allow_cache 1 -hls_segment_filename
'/shared/www/html/video/live/live%03d.ts' -segment_list_flags +live
-override_ffserver http://localhost:8090/feed1.ffm
ffmpeg version 2.6.git Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/home/ubuntu/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/ubuntu/ffmpeg_build/include
--extra-ldflags=-L/home/ubuntu/ffmpeg_build/lib --bindir=/home/ubuntu/bin
--enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 35.101 / 56. 35.101
libavformat 56. 31.100 / 56. 31.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.100 / 5. 16.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/ubuntu/video/sample.mp4':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
creation_time : 1970-01-01 00:00:00
encoder : Lavf52.73.0
Duration: 00:09:56.46, start: 0.000000, bitrate: 524 kb/s
Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuv420p, 424x240, 420 kb/s, 24 fps, 24 tbr, 24 tbn, 48 tbc
(default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : DataHandler
encoder : libx264
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz,
stereo, fltp, 99 kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : DataHandler
Output #0, ffm, to 'http://localhost:8090/feed1.ffm':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
creation_time : now
encoder : Lavf56.31.100
Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p, 424x240,
q=2-31, 420 kb/s, 24 fps, 24 tbr, 1000k tbn, 24 tbc (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : DataHandler
encoder : libx264
Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, 99
kb/s (default)
Metadata:
creation_time : 1970-01-01 00:00:00
handler_name : DataHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame= 13 fps=0.0 q=-1.0 size= 16kB time=00:00:00.54 bitrate=
242.0kbits/frame= 25 fps= 25 q=-1.0 size= 32kB time=00:00:01.04
bitrate= 250.8kbits/frame= 37 fps= 24 q=-1.0 size= 56kB
time=00:00:01.55 bitrate= 294.6kbits/
So when I feed this to ffserver, none of the segment/hls options take
effect, more importantly the ones with the filename paths. All I see are ts
files being written to the local directory where ffserver was launched, and
the m3u8 file is only written as ".tmp" and unable to be renamed
$ sudo bin/ffserver
ffserver version 2.6.git Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)
configuration: --prefix=/home/ubuntu/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/ubuntu/ffmpeg_build/include
--extra-ldflags=-L/home/ubuntu/ffmpeg_build/lib --bindir=/home/ubuntu/bin
--enable-gpl --enable-libass --enable-libfdk-aac --enable-libfreetype
--enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis
--enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
libavutil 54. 23.101 / 54. 23.101
libavcodec 56. 35.101 / 56. 35.101
libavformat 56. 31.100 / 56. 31.100
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 16.100 / 5. 16.100
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 1.100 / 1. 1.100
libpostproc 53. 3.100 / 53. 3.100
/etc/ffserver.conf:82: Setting default value for audio bit rate = 64000.
Use NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for audio sample rate = 22050.
Use NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for audio channel count = 1.
Use NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for video bit rate = 64000.
Use NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for video frame rate = 5. Use
NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for video size = 160x128. Use
NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for video bit rate tolerance =
16000. Use NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for video rate control
equation = tex^qComp. Use NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for video max rate = 128000.
Use NoDefaults to disable it.
/etc/ffserver.conf:82: Setting default value for video buffer size =
128000. Use NoDefaults to disable it.
Sun May 17 19:26:14 2015 FFserver started.
Sun May 17 19:26:23 2015 45.50.16.215 - - [GET] "/stat.html HTTP/1.1" 200
1871
Sun May 17 19:26:31 2015 [hls @ 0x3107c70]failed to rename file .tmp to
Sun May 17 19:26:33 2015 [hls @ 0x3107c70]failed to rename file .tmp to
Sun May 17 19:26:35 2015 [hls @ 0x3107c70]failed to rename file .tmp to
The ffmpeg command works fine standalone, it'll create the appropriate ts
files and m3u8 file in the appropriate directory. It just doesn't work via
ffserver.
thank you
Ricardo
More information about the ffmpeg-user
mailing list