[FFmpeg-user] Can't write on the http stream on ffserver with h264 codec

bigdoby bigdoby at gmail.com
Mon Mar 3 18:24:12 CET 2014


Hi all,
I have a problem with ffmpeg and ffserver, I can't stream to ffserver,
below you can find the log.
After a few seconds it quits, but with ffplay I can see it worked at least
once. If i remove "-f h264" from the command it runs well but uses mjpeg
codec instead of h264.


ffmpeg started on 2014-03-03 at 18:08:40
Report written to "ffmpeg-20140303-180840.log"
Command line:
ffmpeg -f v4l2 -framerate 15 -re -i /dev/video10 -an -s 160x120 -ss
00:00:05 -c:v libx264 -b:v 50k -bt 50k -f h264 -preset placebo -r 15
-pix_fmt yuv420p http://localhost:8090/feed1.ffm -report
ffmpeg version N-57033-g7ab8bce Copyright (c) 2000-2013 the FFmpeg
developers
  built on Oct 10 2013 14:42:06 with gcc 4.7 (Ubuntu/Linaro 4.7.3-1ubuntu1)
  configuration: --enable-pthreads --enable-libmp3lame --enable-libmodplug
--enable-libfaac --enable-libpulse --enable-libssh --enable-libtheora
--enable-libvorbis --enable-libx264 --enable-libxvid --enable-openal
--enable-gpl --enable-nonfree
  libavutil      52. 46.101 / 52. 46.101
  libavcodec     55. 35.100 / 55. 35.100
  libavformat    55. 19.100 / 55. 19.100
  libavdevice    55.  4.100 / 55.  4.100
  libavfilter     3. 88.101 /  3. 88.101
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.103 /  0. 17.103
  libpostproc    52.  3.100 / 52.  3.100
Splitting the commandline.
Reading option '-f' ... matched as option 'f' (force format) with argument
'v4l2'.
Reading option '-framerate' ... matched as AVOption 'framerate' with
argument '15'.
Reading option '-re' ... matched as option 're' (read input at native frame
rate) with argument '1'.
Reading option '-i' ... matched as input file with argument '/dev/video10'.
Reading option '-an' ... matched as option 'an' (disable audio) with
argument '1'.
Reading option '-s' ... matched as option 's' (set frame size (WxH or
abbreviation)) with argument '160x120'.
Reading option '-ss' ... matched as option 'ss' (set the start time offset)
with argument '00:00:05'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument
'libx264'.
Reading option '-b:v' ... matched as option 'b' (video bitrate (please use
-b:v)) with argument '50k'.
Reading option '-bt' ... matched as AVOption 'bt' with argument '50k'.
Reading option '-f' ... matched as option 'f' (force format) with argument
'h264'.
Reading option '-preset' ... matched as AVOption 'preset' with argument
'placebo'.
Reading option '-r' ... matched as option 'r' (set frame rate (Hz value,
fraction or abbreviation)) with argument '15'.
Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel
format) with argument 'yuv420p'.
Reading option 'http://localhost:8090/feed1.ffm' ... matched as output file.
Reading option '-report' ... matched as option 'report' (generate a report)
with argument '1'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file /dev/video10.
Applying option f (force format) with argument v4l2.
Applying option re (read input at native frame rate) with argument 1.
Successfully parsed a group of options.
Opening an input file: /dev/video10.
[video4linux2,v4l2 @ 0xea85a0] fd:4 capabilities:84000001
[video4linux2,v4l2 @ 0xea85a0] Current input_channel: 0, input_name: Camera
1, input_std: 0
[video4linux2,v4l2 @ 0xea85a0] Querying the device for the current frame
size
[video4linux2,v4l2 @ 0xea85a0] Setting frame size to 640x480
[video4linux2,v4l2 @ 0xea85a0] The V4L2 driver changed the pixel format
from 0x32315559 to 0x47504A4D
[video4linux2,v4l2 @ 0xea85a0] Trying to set codec:rawvideo pix_fmt:yuv420p
[video4linux2,v4l2 @ 0xea85a0] The V4L2 driver changed the pixel format
from 0x32315559 to 0x47504A4D
[video4linux2,v4l2 @ 0xea85a0] Trying to set codec:rawvideo pix_fmt:yuv420p
[video4linux2,v4l2 @ 0xea85a0] The V4L2 driver changed the pixel format
from 0x32315659 to 0x47504A4D
[video4linux2,v4l2 @ 0xea85a0] Trying to set codec:rawvideo pix_fmt:yuv422p
[video4linux2,v4l2 @ 0xea85a0] The V4L2 driver changed the pixel format
from 0x50323234 to 0x47504A4D
[video4linux2,v4l2 @ 0xea85a0] Trying to set codec:rawvideo pix_fmt:yuyv422
[video4linux2,v4l2 @ 0xea85a0] Setting time per frame to 1/15
[video4linux2,v4l2 @ 0xea85a0] All info found
Input #0, video4linux2,v4l2, from '/dev/video10':
  Duration: N/A, start: 32396.529108, bitrate: 73728 kb/s
    Stream #0:0, 1, 1/1000000: Video: rawvideo (YUY2 / 0x32595559),
yuyv422, 640x480, 73728 kb/s, 15 fps, 15 tbr, 1000k tbn, 1000k tbc
Successfully opened the file.
Parsing a group of options: output file http://localhost:8090/feed1.ffm.
Applying option an (disable audio) with argument 1.
Applying option s (set frame size (WxH or abbreviation)) with argument
160x120.
Applying option ss (set the start time offset) with argument 00:00:05.
Applying option c:v (codec name) with argument libx264.
Applying option b:v (video bitrate (please use -b:v)) with argument 50k.
Applying option f (force format) with argument h264.
Applying option r (set frame rate (Hz value, fraction or abbreviation))
with argument 15.
Applying option pix_fmt (set pixel format) with argument yuv420p.
Successfully parsed a group of options.
Opening an output file: http://localhost:8090/feed1.ffm.
Successfully opened the file.
detected 4 logical cores
[graph 0 input from stream 0:0 @ 0xe960c0] Setting 'video_size' to value
'640x480'
[graph 0 input from stream 0:0 @ 0xe960c0] Setting 'pix_fmt' to value '1'
[graph 0 input from stream 0:0 @ 0xe960c0] Setting 'time_base' to value
'1/1000000'
[graph 0 input from stream 0:0 @ 0xe960c0] Setting 'pixel_aspect' to value
'0/1'
[graph 0 input from stream 0:0 @ 0xe960c0] Setting 'sws_param' to value
'flags=2'
[graph 0 input from stream 0:0 @ 0xe960c0] Setting 'frame_rate' to value
'15/1'
[graph 0 input from stream 0:0 @ 0xe960c0] w:640 h:480 pixfmt:yuyv422
tb:1/1000000 fr:15/1 sar:0/1 sws_param:flags=2
[scaler for output stream 0:0 @ 0xe9ca80] Setting 'w' to value '160'
[scaler for output stream 0:0 @ 0xe9ca80] Setting 'h' to value '120'
[scaler for output stream 0:0 @ 0xe9ca80] Setting 'flags' to value '0x4'
[scaler for output stream 0:0 @ 0xe9ca80] w:160 h:120 flags:'0x4' interl:0
[format @ 0xeaba70] compat: called with args=[yuv420p]
[format @ 0xeaba70] Setting 'pix_fmts' to value 'yuv420p'
[AVFilterGraph @ 0xea2410] query_formats: 6 queried, 5 merged, 0 already
done, 0 delayed
[scaler for output stream 0:0 @ 0xe9ca80] w:640 h:480 fmt:yuyv422 sar:0/1
-> w:160 h:120 fmt:yuv420p sar:0/1 flags:0x4
[libx264 @ 0xeaa2e0] using mv_range_thread = 24
[libx264 @ 0xeaa2e0] using cpu capabilities: ARMv6 NEON
[libx264 @ 0xeaa2e0] profile High, level 1.2
Output #0, h264, to 'http://localhost:8090/feed1.ffm':
  Metadata:
    encoder         : Lavf55.19.100
    Stream #0:0, 0, 1/90000: Video: h264 (libx264), yuv420p, 160x120,
q=-1--1, 50 kb/s, 90k tbn, 15 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo -> libx264)
Press [q] to stop, [?] for help
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=    3 fps=0.6 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   11 fps=2.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   18 fps=3.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   26 fps=4.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   34 fps=4.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   41 fps=5.4 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   49 fps=6.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   56 fps=6.5 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   64 fps=7.0 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   72 fps=7.5 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   79 fps=7.8 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
frame=   87 fps=8.2 q=0.0 size=       0kB time=00:00:00.00 bitrate=N/A
[libx264 @ 0xeaa2e0] frame=   0 QP=29.73 NAL=3 Slice:I Poc:0   I:80   P:0
 SKIP:0    size=1658 bytes
[libx264 @ 0xeaa2e0] frame=   1 QP=35.81 NAL=2 Slice:P Poc:12  I:0    P:23
  SKIP:57   size=63 bytes


What's wrong with the command? It's not possible to write to http ffserver
with h264?
Using other options I have also this error in the logs:

av_interleaved_write_frame(): Connection reset by peer

Thank you very much

R.


More information about the ffmpeg-user mailing list