Hi I'm trying to stream video from a camera to a twitch stream (ghoto2 -> ffmpeg -> twitch) . It works good without audio, but twitch doesn't like the stream. Therefore I want to add a silent audio track. This I'm doing with the aevalsrc filter, but this gives me an DTS error for the flv output (it runs for a second and then crashes)? How do I make sure the streams are synchronised?
command and output can be found below. Cheers Pål gphoto2 --capture-movie --stdout | ffmpeg -f lavfi -i aevalsrc=0 -f mjpeg -i pipe:0 -threads 4 -f flv \ -vf drawtext="fontfile=/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-R.ttf:text='Test':timecode='$(date +%H\\:%M\\:%S).00': r=29.97: x=(w-tw)/2: y=h-(1*lh): fontcolor=white: fontsize=16: box=1: boxcolor=0x00000999" \ -vcodec libx264 -acodec aac -map 0:0 -map 1:0 -shortest -strict experimental -y -r 29.97 -b:v 10000k $server$key CCapturing preview frames as movie to 'stdout'. Press Ctrl-C to abort. ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg developers built on Nov 22 2014 17:07:19 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) configuration: --prefix=/usr --extra-version='1ubuntu1~trusty6' --build-suffix=-ffmpeg --toolchain=hardened --extra-cflags= --extra-cxxflags= --libdir=/usr/lib/x86_64-linux-gnu --shlibdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --enable-shared --disable-stripping --enable-avresample --enable-avisynth --enable-fontconfig --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-opengl --enable-x11grab --enable-libxvid --enable-libx265 --enable-libdc1394 --enable-libiec61883 --enable-libzvbi --enable-libzmq --enable-frei0r --enable-libx264 --enable-libsoxr --enable-openal --enable-libopencv libavutil 54. 7.100 / 54. 7.100 libavcodec 56. 1.100 / 56. 1.100 libavformat 56. 4.101 / 56. 4.101 libavdevice 56. 0.100 / 56. 0.100 libavfilter 5. 1.100 / 5. 1.100 libavresample 2. 1. 0 / 2. 1. 0 libswscale 3. 0.100 / 3. 0.100 libswresample 1. 1.100 / 1. 1.100 libpostproc 53. 0.100 / 53. 0.100 Input #0, lavfi, from 'aevalsrc=0': Duration: N/A, start: 0.000000, bitrate: 2822 kb/s Stream #0:0: Audio: pcm_f64le, 44100 Hz, mono, dbl, 2822 kb/s Input #1, mjpeg, from 'pipe:0': Duration: N/A, bitrate: N/A Stream #1:0: Video: mjpeg, yuvj422p(pc, bt470bg), 640x426, 25 tbr, 1200k tbn, 25 tbc No pixel format specified, yuvj422p for H.264 encoding chosen. Use -pix_fmt yuv420p for compatibility with outdated media players. [libx264 @ 0x1673e80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 0x1673e80] profile High 4:2:2, level 3.0, 4:2:2 8-bit [libx264 @ 0x1673e80] 264 - core 142 r2389 956c8d8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2014 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=4 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=10000 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00 Output #0, flv, to 'rtmp://live-arn.justin.tv/app/live_XXX': Metadata: encoder : Lavf56.4.101 Stream #0:0: Audio: aac ([10][0][0][0] / 0x000A), 44100 Hz, mono, fltp, 128 kb/s Metadata: encoder : Lavc56.1.100 aac Stream #0:1: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuvj422p, 640x426, q=-1--1, 10000 kb/s, 29.97 fps, 1k tbn, 29.97 tbc Metadata: encoder : Lavc56.1.100 libx264 Stream mapping: Stream #0:0 -> #0:0 (pcm_f64le (native) -> aac (native)) Stream #1:0 -> #0:1 (mjpeg (native) -> h264 (libx264)) *[flv @ 0x1670b40] Packets are not in the proper order with respect to DTSkbits/s * av_interleaved_write_frame(): Invalid argument [flv @ 0x1670b40] Failed to update header with correct duration. [flv @ 0x1670b40] Failed to update header with correct filesize. frame= 49 fps= 20 q=-1.0 Lsize= 682kB time=00:12:49.06 bitrate= 7.3kbits/s video:77kB audio:131kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 227.815689% [libx264 @ 0x1673e80] frame I:1 Avg QP: 2.75 size: 77761 [libx264 @ 0x1673e80] frame P:13 Avg QP: 1.20 size: 56625 [libx264 @ 0x1673e80] frame B:35 Avg QP: 4.67 size: 28212 [libx264 @ 0x1673e80] consecutive B-frames: 2.0% 8.2% 0.0% 89.8% [libx264 @ 0x1673e80] mb I I16..4: 18.1% 71.5% 10.5% [libx264 @ 0x1673e80] mb P I16..4: 9.3% 6.5% 0.1% P16..4: 35.7% 22.1% 16.6% 0.0% 0.0% skip: 9.6% [libx264 @ 0x1673e80] mb B I16..4: 0.4% 0.6% 0.0% B16..8: 35.3% 15.0% 19.7% direct:18.7% skip:10.3% L0:49.7% L1:38.8% BI:11.5% [libx264 @ 0x1673e80] final ratefactor: -0.82 [libx264 @ 0x1673e80] 8x8 transform intra:52.0% inter:95.4% [libx264 @ 0x1673e80] coded y,uvDC,uvAC intra: 28.0% 24.0% 7.0% inter: 57.3% 57.9% 30.8% [libx264 @ 0x1673e80] i16 v,h,dc,p: 75% 13% 11% 1% [libx264 @ 0x1673e80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 18% 45% 2% 1% 1% 1% 2% 3% [libx264 @ 0x1673e80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 22% 14% 15% 7% 7% 7% 6% 9% 12% [libx264 @ 0x1673e80] i8c dc,h,v,p: 66% 15% 18% 1% [libx264 @ 0x1673e80] Weighted P-Frames: Y:7.7% UV:7.7% [libx264 @ 0x1673e80] ref P L0: 51.6% 3.2% 23.3% 21.9% 0.0% [libx264 @ 0x1673e80] ref B L0: 67.6% 24.4% 8.0% [libx264 @ 0x1673e80] ref B L1: 81.1% 18.9% [libx264 @ 0x1673e80] kb/s:7197.96 Conversion failed! _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user