[FFmpeg-user] Broken video in rtmp stream to Wowza using tee pseudo-muxer

Erwin Eggenberger eeggenberger+ffmpeg at techcast.com
Thu Feb 1 14:52:06 EET 2018


Hi Carl Eugen,

I finally had the chance to look into this again. Here's the command and
its output that isn't working:

ffmpeg -y -v info -f x11grab -draw_mouse 0 -r 25 -s 1280x720 \
 -thread_queue_size 4096 -i :0.0+0,0 -f alsa -thread_queue_size 4096 \
 -i hw:0,1,0 -acodec aac -strict -2 -ar 44100 -c:v libx264 -preset
veryfast \
 -maxrate 2976k -bufsize 5952k -pix_fmt yuv420p -r 25 -crf 25 -g 50 \
 -tune zerolatency \
 -f tee -map 0:v -map 1:a \
 "[f=flv]rtmp://user:password@wowza-server.tld:1935/live/tcfw_demo_db728"

Output:
ffmpeg version N-89907-g293f24b Copyright (c) 2000-2018 the FFmpeg
developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.5) 20160609
  configuration: --prefix=/home/eeggenberger/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/eeggenberger/ffmpeg_build/include
--extra-ldflags=-L/home/eeggenberger/ffmpeg_build/lib
--extra-libs='-lpthread -lm' --bindir=/home/eeggenberger/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      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  6.100 / 58.  6.100
  libavdevice    58.  0.101 / 58.  0.101
  libavfilter     7. 11.101 /  7. 11.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
[x11grab @ 0x35aaf80] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Input #0, x11grab, from ':0.0+0,0':
  Duration: N/A, start: 1517487900.599421, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x720, 25
fps, 1000k tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:0,1,0':
  Duration: N/A, start: 1517487900.643670, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x35c84c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2
[libx264 @ 0x35c84c0] profile High, level 3.1
[rtmp @ 0x3fda200] Ignoring unsupported var reason
Output #0, tee, to
'[f=flv]rtmp://techcast:oleander@cdn.techcast.com:1935/live/tcfw_demo_db728':
  Metadata:
    encoder         : Lavf58.6.100
    Stream #0:0: Video: h264 (libx264), yuv420p(progressive), 1280x720,
q=-1--1, 25 fps, 25 tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.9.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 2976000/0/0 buffer size: 5952000
vbv_delay: -1
    Stream #0:1: Audio: aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.9.100 aac
frame=   12 fps=0.0 q=24.0 size=N/A time=00:00:00.48 bitrate=N/A
speed=0.943x
frame=   25 fps= 25 q=23.0 size=N/A time=00:00:01.00 bitrate=N/A
speed=0.987x
frame=   37 fps= 24 q=23.0 size=N/A time=00:00:01.48 bitrate=N/A
speed=0.973x
... similar messages repeated ...
frame= 2818 fps= 25 q=23.0 size=N/A time=00:01:52.72 bitrate=N/A speed=
 1x
frame= 2830 fps= 25 q=23.0 size=N/A time=00:01:53.20 bitrate=N/A speed=
 1x
frame= 2843 fps= 25 q=23.0 size=N/A time=00:01:53.72 bitrate=N/A speed=
 1x
[flv @ 0x3fd7f00] Failed to update header with correct duration.
[flv @ 0x3fd7f00] Failed to update header with correct filesize.
frame= 2855 fps= 25 q=23.0 Lsize=N/A time=00:01:54.20 bitrate=N/A speed=
  1x
video:9655kB audio:1790kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: unknown
[libx264 @ 0x35c84c0] frame I:58    Avg QP:17.26  size: 48561
[libx264 @ 0x35c84c0] frame P:2797  Avg QP:18.06  size:  2528
[libx264 @ 0x35c84c0] mb I  I16..4: 24.2% 40.0% 35.9%
[libx264 @ 0x35c84c0] mb P  I16..4:  2.5%  0.2%  0.0%  P16..4: 23.1%
2.4%  0.5%  0.0%  0.0%    skip:71.2%
[libx264 @ 0x35c84c0] 8x8 transform intra:21.9% inter:16.9%
[libx264 @ 0x35c84c0] coded y,uvDC,uvAC intra: 37.3% 79.3% 43.8% inter:
0.6% 21.5% 0.5%
[libx264 @ 0x35c84c0] i16 v,h,dc,p: 50% 24% 21%  6%
[libx264 @ 0x35c84c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 22% 22%  6%  6%
 2% 16%  5% 10%
[libx264 @ 0x35c84c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 24% 12%  6%  8%
 4% 19%  5%  8%
[libx264 @ 0x35c84c0] i8c dc,h,v,p: 54% 23% 19%  5%
[libx264 @ 0x35c84c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x35c84c0] kb/s:692.58
[aac @ 0x35c9780] Qavg: 247.443
Exiting normally, received signal 2.

For comparison, this is the working command without tee:

ffmpeg -y -v info -f x11grab -draw_mouse 0 -r 25 -s 1280x720 \
 -thread_queue_size 4096 -i :0.0+0,0 -f alsa -thread_queue_size 4096 \
 -i hw:0,1,0 -acodec aac -strict -2 -ar 44100 -c:v libx264 -preset
veryfast \
 -maxrate 2976k -bufsize 5952k -pix_fmt yuv420p -r 25 -crf 25 -g 50 \
 -tune zerolatency \
 -f flv rtmp://user:password@wowza-server.tld:1935/live/tcfw_demo_db728

Output:
ffmpeg version N-89907-g293f24b Copyright (c) 2000-2018 the FFmpeg
developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.5) 20160609
  configuration: --prefix=/home/eeggenberger/ffmpeg_build
--pkg-config-flags=--static
--extra-cflags=-I/home/eeggenberger/ffmpeg_build/include
--extra-ldflags=-L/home/eeggenberger/ffmpeg_build/lib
--extra-libs='-lpthread -lm' --bindir=/home/eeggenberger/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      56.  7.100 / 56.  7.100
  libavcodec     58.  9.100 / 58.  9.100
  libavformat    58.  6.100 / 58.  6.100
  libavdevice    58.  0.101 / 58.  0.101
  libavfilter     7. 11.101 /  7. 11.101
  libswscale      5.  0.101 /  5.  0.101
  libswresample   3.  0.101 /  3.  0.101
  libpostproc    55.  0.100 / 55.  0.100
[x11grab @ 0x3ffbf40] Stream #0: not enough frames to estimate rate;
consider increasing probesize
Input #0, x11grab, from ':0.0+0,0':
  Duration: N/A, start: 1517487760.405432, bitrate: N/A
    Stream #0:0: Video: rawvideo (BGR[0] / 0x524742), bgr0, 1280x720, 25
fps, 1000k tbr, 1000k tbn, 1000k tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, alsa, from 'hw:0,1,0':
  Duration: N/A, start: 1517487760.451644, bitrate: 1536 kb/s
    Stream #1:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[rtmp @ 0x401d4c0] Ignoring unsupported var reason
Stream mapping:
  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
  Stream #1:0 -> #0:1 (pcm_s16le (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x4019740] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2
[libx264 @ 0x4019740] profile High, level 3.1
[libx264 @ 0x4019740] 264 - core 155 - H.264/MPEG-4 AVC codec - Copyleft
2003-2018 - http://www.videolan.org/x264.html - options: cabac=1 ref=1
deblock=1:0:0 analyse=0x3:0x113 me=hex subme=2 psy=1 psy_rd=1.00:0.00
mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0
deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=4
lookahead_threads=4 sliced_threads=1 slices=4 nr=0 decimate=1
interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1
keyint=50 keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=0 rc=crf
mbtree=0 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2976
vbv_bufsize=5952 crf_max=0.0 nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to
'rtmp://techcast:oleander@cdn.techcast.com:1935/live/tcfw_demo_db728':
  Metadata:
    encoder         : Lavf58.6.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007),
yuv420p(progressive), 1280x720, q=-1--1, 25 fps, 1k tbn, 25 tbc
    Metadata:
      encoder         : Lavc58.9.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 2976000/0/0 buffer size: 5952000
vbv_delay: -1
    Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz,
stereo, fltp, 128 kb/s
    Metadata:
      encoder         : Lavc58.9.100 aac
frame=   18 fps=0.0 q=24.0 size=      98kB time=00:00:00.69
bitrate=1155.1kbits/s speed=1.37x
frame=   31 fps= 31 q=22.0 size=     130kB time=00:00:01.21 bitrate=
882.0kbits/s speed=1.19x
frame=   43 fps= 28 q=21.0 size=     160kB time=00:00:01.72 bitrate=
762.1kbits/s speed=1.13x
frame=   56 fps= 28 q=23.0 size=     232kB time=00:00:02.20 bitrate=
859.9kbits/s speed=1.09x
... similar messages repeated ...
frame= 1294 fps= 25 q=21.0 size=    4190kB time=00:00:51.73 bitrate=
663.5kbits/s speed=   1x
frame= 1307 fps= 25 q=23.0 size=    4266kB time=00:00:52.24 bitrate=
668.9kbits/s speed=   1x
frame= 1320 fps= 25 q=23.0 size=    4299kB time=00:00:52.76 bitrate=
667.5kbits/s speed=   1x
[flv @ 0x4017780] Failed to update header with correct duration.
[flv @ 0x4017780] Failed to update header with correct filesize.
frame= 1322 fps= 25 q=23.0 Lsize=    4306kB time=00:00:52.87 bitrate=
667.1kbits/s speed=   1x
video:3409kB audio:829kB subtitle:0kB other streams:0kB global
headers:0kB muxing overhead: 1.602683%
[libx264 @ 0x4019740] frame I:27    Avg QP:16.74  size: 46784
[libx264 @ 0x4019740] frame P:1295  Avg QP:17.30  size:  1720
[libx264 @ 0x4019740] mb I  I16..4: 24.8% 39.7% 35.5%
[libx264 @ 0x4019740] mb P  I16..4:  1.6%  0.1%  0.0%  P16..4: 16.4%
1.5%  0.4%  0.0%  0.0%    skip:80.1%
[libx264 @ 0x4019740] 8x8 transform intra:23.7% inter:13.0%
[libx264 @ 0x4019740] coded y,uvDC,uvAC intra: 45.7% 75.0% 38.4% inter:
0.3% 14.4% 0.1%
[libx264 @ 0x4019740] i16 v,h,dc,p: 59% 20% 16%  5%
[libx264 @ 0x4019740] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 11% 23% 16%  7%  6%
 2% 17%  6% 11%
[libx264 @ 0x4019740] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 15% 24% 12%  6%  8%
 4% 18%  5%  8%
[libx264 @ 0x4019740] i8c dc,h,v,p: 52% 24% 20%  5%
[libx264 @ 0x4019740] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x4019740] kb/s:528.04
[aac @ 0x401aa00] Qavg: 248.935
Exiting normally, received signal 2.

I've already used diff to find differences in the output, but there
isn't anything obvious. I only noticed that the line starting with "264
- core 155 - H.264/MPEG-4 AVC codec - Copyleft 2003-2018" doesn't show
up in the output when I use tee. Everything else looks more or less the
same.

Regards,

Erwin

Am 25.01.2018 um 11:21 schrieb Carl Eugen Hoyos:
> 2018-01-24 16:36 GMT+01:00 Erwin Eggenberger <eeggenberger+ffmpeg at techcast.com>:
> 
>> When I just upload the stream without the tee muxer, everything works as
>> expected, but with tee I only get audio but no video. In the Wowza logs
>> I can see errors like this:
>> H264Utils.decodeAVCC : java.lang.ArrayIndexOutOfBoundsException
>>
>> Sounds to me like there's something wrong with the h.264 video. The
>> ffmpeg command looks like this:
>>
>> ffmpeg -y -v info -f x11grab -draw_mouse 0 -r 25 -s 1280x720
>> -thread_queue_size 4096 -i :0.0+0,0 -f alsa \
>>   -thread_queue_size 4096 -i hw:0,1,0 -acodec aac -strict -2 -ar 44100
>> -c:v libx264 -preset veryfast \
>>   -maxrate 2976k -bufsize 5952k -pix_fmt yuv420p -r 25 -crf 25 -g 50
>> -tune zerolatency \
>>   -f tee -map 0:v -map 1:a
>> "[f=flv]rtmp://user:password@servername:1935/live/test_stream"
> 
> Please also provide the complete, uncut console output.
> 
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> 


More information about the ffmpeg-user mailing list