[FFmpeg-user] Streaming to YouTube Live

First Last yangmath2020 at gmail.com
Sat Apr 18 01:02:21 EEST 2020

I am uncertain whether this question is outside the scope of this forum, so
please advise me if it is.

I am attempting to stream a single static image to YouTube Live, using an
Amazon Linux server running on Amazon Lightsail, and using, of course,

I am using the following command:

/home/ec2-user/ffmpeg-git-20200324-amd64-static/ffmpeg -re -loop 1
-framerate 2 -i /home/ec2-user/testrun.jpg -s 1920x1080 -ab 128k -vcodec
libx264 -pix_fmt yuv420p -maxrate 2048k -bufsize 2048k -framerate 30 -g 2
-strict experimental -f flv

It is a command I adapted from the edit on the response of the solution
found on:


The only modifications I have made to the core command is removing the audio
stream, and changing the output resolution to match the optimal resolution
recommended for YouTube.


The resulting problem is that while ffmpeg appears to be successfully
streaming data, albeit with a few warnings I do not have an understanding
of, YouTube is not receiving data. Thank you for any assistance. I am
pasting the full out of my console below.


ffmpeg version N-52056-ge5d25d1147-static https://johnvansickle.com/ffmpeg/ 
Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio --d
isable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gmp --enable-libgme --enable-gra
y --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf
--enable-libfreetype --enable-libmp3lame --enable-l
ibopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-librubberband --enable-libsoxr --enable-libspeex
 --enable-libsrt --enable-libvorbis --enable-libopus --enable-libtheora
--enable-libvidstab --enable-libvo-amrwbenc --enab
le-libvpx --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxml2 --enable-libdav1d --enable-libxvid --enable-
libzvbi --enable-libzimg
  libavutil      56. 42.101 / 56. 42.101
  libavcodec     58. 76.100 / 58. 76.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.100 /  7. 77.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, image2, from '/home/ec2-user/testrun.jpg':
  Duration: 00:00:00.50, start: 0.000000, bitrate: 12262 kb/s
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc,
bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 2 fps, 2 tb
r, 2 tbn, 2 tbc
Codec AVOption b (set bitrate (in bits/s)) specified for output file #0
dg) has not been used for any stream. The most likely reason is either wrong
type (e.g. a video option with no video strea
ms) or that it is a private option of some encoder which was not actually
used for any stream.
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[swscaler @ 0x5a4b6c0] deprecated pixel format used, make sure you did set
range correctly
[libx264 @ 0x585da00] using SAR=1/1
[libx264 @ 0x585da00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x585da00] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x585da00] 264 - core 159 r2991 1771b55 - H.264/MPEG-4 AVC codec
- Copyleft 2003-2019 - 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_r
ange=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1
chroma_qp_offset=-2 threads=1 lookahead_threads=1
 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0
constrained_intra=0 bframes=1 b_pyramid=0 b_adapt=1 b_bias=
0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=2 keyint_min=1 scenecut=40
intra_refresh=0 rc_lookahead=2 rc=crf mbtree=1
 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=2048
vbv_bufsize=2048 crf_max=0.0 nal_hrd=none filler=0 ip_rati
o=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx':
    encoder         : Lavf58.42.100
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p,
1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 2 fps, 1k 
tbn, 2 tbc
      encoder         : Lavc58.76.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 2048000/0/0 buffer size: 2048000 vbv_delay:
[flv @ 0x585f640] Failed to update header with correct
duration.ate=2004.3kbits/s speed=0.992x    8x    
[flv @ 0x585f640] Failed to update header with correct filesize.
frame=  609 fps=2.0 q=24.0 Lsize=   74240kB time=00:05:03.50
bitrate=2003.9kbits/s speed=0.997x    

Sent from: http://www.ffmpeg-archive.org/

More information about the ffmpeg-user mailing list