[FFmpeg-user] recent ffserver won't pass codec parameters to a defined feed

Alex Morris axman.5389 at gmail.com
Sat Jul 16 00:07:51 EEST 2016


Recent ffserver seems to have lost the ability to set or pass along
codec parameters for a defined feed in ffserver.conf.

Snapshot N-81008-g87e9cef shows broken behaviour.
Git master shows broken behaviour.
Snapshot N-79115-g65cff81 works correctly.

To recreate:

1) Using git master, build ffmpeg & ffserver with the following buildconf;

--enable-gpl --enable-nonfree --enable-version3 --enable-shared
--enable-pic --enable-libx264 --enable-fontconfig --enable-libfreetype
--enable-libfribidi --enable-libtheora --enable-librtmp
--enable-libschroedinger --enable-libvorbis --enable-libvpx

2) Configure ffserver.conf with the following;

HTTPPort 9123
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 20
MaxClients 10
MaxBandwidth 6000
CustomLog -
<Feed feed2.ffm>
# h264 is the master input source
File /tmp/client/feed2.ffm
FileMaxSize 500k
</Feed>
<Feed feed4.ffm>
# windows asf #2 for stream consumer
File /tmp/client/feed4.ffm
FileMaxSize 500k
</Feed>
<Feed feed7.ffm>
# libvpx / webm for stream consumer
File /tmp/client/feed7.ffm
FileMaxSize 500M
</Feed>
<Stream test.flv>
Format flv
Feed feed2.ffm
VideoCodec libx264
VideoFrameRate 30
VideoBitRate 400
VideoSize 320x240
PixelFormat yuv420p
AVOptionVideo flags +global_header
NoAudio
NoDefaults
</Stream>
<Stream msvideo1.asf>
Feed feed4.ffm
Format asf_stream
VideoCodec wmv1
VideoFrameRate 30
VideoBitRate 400
VideoSize 320x240
VideoBufferSize 40
VideoGopSize 30
StartSendOnKey
NoAudio
NoDefaults
</Stream>
<Stream stream.webm>
Format webm
Feed feed7.ffm
VideoCodec libvpx
VideoFrameRate 30
VideoBitRate 400
VideoSize 320x240
VideoGopSize 15
PixelFormat yuv420p
StartSendOnKey
Preroll 0
NoAudio
NoDefaults
</Stream>
<Stream status.html>
Format status
</Stream>

3) run a live stream from an ffmpeg client to an ffserver.  In this
test case, video source is a GoPro 3B outputting to a Hauppauge USB tv
tuner.  I suppose streaming a static file to ffserver would also
demonstrate the broken behaviour.

on client; (version N-79115-g65cff81)

/usr/local/bin/ffmpeg -loglevel quiet -f v4l2 -standard NTSC-M
-channel 1 -framerate 29.97 -video_size 720x480 -pixel_format yuv444p
-i /dev/video0 -c:a none -c:v libx264 -profile:v high444 -level 3.0
-b:v 400k -r 30 -s 720x480 http://server.ip.addr:9123/feed2.ffm

4) Attempt to view the stream provided by ffserver, with ffplay for example.

ffplay http://server.ip.addr:9123/stream.webm
  endless repeats of
[h264 @ 0x1cdf480] decode_slice_header error
[h264 @ 0x1cdf480] no frame!
[h264 @ 0x1cdf480] non-existing PPS 0 referenced
  until I kill it.
Same failing results occur for the ffserver's flv and wmv url's.

4a) Alternate method to prove nothing comes out of ffserver;

Run ffmpeg on the server.ip.addr  and attempt to copy the ffserver's
url output stream to a file - local - on the server.ip.addr - this
method shows more details, and if I read correctly, shows ffserver is
not passing codec parameters through the defined feed..

user at ip-10-0-0-12:~/scripts$ ffmpeg -i http://127.0.0.1:9123/test.flv out.mp4
ffmpeg version N-81026-gb701ec4 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --enable-gpl --enable-nonfree --enable-version3
--enable-shared --enable-pic --enable-libx264 --enable-fontconfig
--enable-libfreetype --enable-libfribidi --enable-libtheora
--enable-libschroedinger --enable-libvorbis --enable-libvpx
--enable-librtmp
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 50.100 / 57. 50.100
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
[flv @ 0x1cdc340] video stream discovered after head already parsed
[NULL @ 0x1cdf480] non-existing PPS 0 referenced
[h264 @ 0x1cdf480] non-existing PPS 0 referenced
[h264 @ 0x1cdf480] decode_slice_header error
[h264 @ 0x1cdf480] no frame!
[h264 @ 0x1cdf480] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1cdf480] decode_slice_header error
[h264 @ 0x1cdf480] no frame!
[h264 @ 0x1cdf480] non-existing PPS 0 referenced
    Last message repeated 1 times
...
[h264 @ 0x1cdf480] decode_slice_header error
[h264 @ 0x1cdf480] no frame!
[h264 @ 0x1cdf480] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1cdf480] decode_slice_header error
[h264 @ 0x1cdf480] no frame!
[h264 @ 0x1cdf480] non-existing PPS 0 referenced
    Last message repeated 1 times
[h264 @ 0x1cdf480] decode_slice_header error
[h264 @ 0x1cdf480] no frame!
[flv @ 0x1cdc340] decoding for stream 0 failed
[flv @ 0x1cdc340] Could not find codec parameters for stream 0 (Video:
h264, none): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, flv, from 'http://127.0.0.1:9123/robot3_test.flv':
  Metadata:
    encoder         : Lavf57.41.100
  Duration: 00:00:00.00, start: 1880989.715000, bitrate: N/A
    Stream #0:0: Video: h264, none, 30 fps, 30 tbr, 1k tbn
File 'out.mp4' already exists. Overwrite ? [y/N] y
[buffer @ 0x1ce2680] Unable to parse option value "0x0" as image size
[buffer @ 0x1ce2680] Unable to parse option value "-1" as pixel format
[buffer @ 0x1ce2680] Unable to parse option value "0x0" as image size
[buffer @ 0x1ce2680] Error setting option video_size to value 0x0.
[graph 0 input from stream 0:0 @ 0x1ce2540] Error applying options to
the filter.
Error opening filters!
Exiting normally, received signal 2.

The resulting out.mp4 is zero length.  Applying full codec parameters
to the ffmpeg command has no positive effect, same errors and info
returned.

ffserver shows the following when the live streamed source arrives.

user at ip-10-0-0-12:~/scripts$ /usr/local/bin/ffserver -f ./ffserver.conf
ffserver version N-81026-gb701ec4 Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.8 (Ubuntu 4.8.4-2ubuntu1~14.04.3)
  configuration: --enable-gpl --enable-nonfree --enable-version3
--enable-shared --enable-pic --enable-libx264 --enable-fontconfig
--enable-libfreetype --enable-libfribidi --enable-libtheora
--enable-libschroedinger --enable-libvorbis --enable-libvpx
--enable-librtmp
  libavutil      55. 28.100 / 55. 28.100
  libavcodec     57. 50.100 / 57. 50.100
  libavformat    57. 41.100 / 57. 41.100
  libavdevice    57.  0.102 / 57.  0.102
  libavfilter     6. 47.100 /  6. 47.100
  libswscale      4.  1.100 /  4.  1.100
  libswresample   2.  1.100 /  2.  1.100
  libpostproc    54.  0.100 / 54.  0.100
Fri Jul 15 19:47:01 2016 FFserver started.

Fri Jul 15 19:49:05 2016 [webm @ 0x2487730]Using AVStream.codec to
pass codec parameters to muxers is deprecated, use AVStream.codecpar
instead.
Fri Jul 15 19:48:13 2016 XXX.XXX.XXX.XXX - - [GET] "/feed2.ffm
HTTP/1.1" 200 4175
Fri Jul 15 19:51:03 2016 127.0.0.1 - - [GET] "/test.flv HTTP/1.1" 200 4560818

Using lsof, I see ffserver open the socket to port 9123 when it launches.
Using tcpdump, I see the traffic from ffmpeg client arrive on the
server running ffserver.
I did not hack at my ffserver.conf, as if there is new syntax,
although it might be the case..

I have a second server running version N-79115-g65cff81 - the above
process works correctly.  Client streams to server, server replicates
incoming source to additional feeds, local-to-server ffmpeg instances
correctly transcode their specific feed to the format which end
consumers can view in their browser or ffplay.  It works sweet.

I noticed many "deprecated" warnings during compile but did not
capture them..  I read the comments in libavformat/avformat.h, re:
AVStream.codecpar .  I'm not capable enough to find where in code to
correct this..  Feels like code is trying to use AVStream.codec rather
than the 'new way<?>'  of AVStream.codecpar ?

Sorry for long post, and extra sorry about raising an issue with
ffserver just after the announcement to drop it..  I would understand
if nothing comes of this, developer resources are strained and it
would be hard to justify working on it.  Feedback is warmly
appreciated.


More information about the ffmpeg-user mailing list