[FFmpeg-user] Live stream to periscope or youtube doesn't seems to work

Guilherme Santos especulador at gmail.com
Mon Dec 11 02:58:11 EET 2017


Hey Lou, wow thanks! amazing info..

I'm playing around but not succeed yet, it connects but screen goes black.

Periscope's info:

Video codec     AVC

Video bitrate   6.949 kbps

Video framerate 5.0332192470304005 fps

Video keyframe interval in seconds      12

Max keyframe interval: 3.0 s.

Video width     1024 px

Video height    768 px

The NEW ffmpeg command:

~/ffmpeg-git-20171206-32bit-static$ ./ffmpeg  -f x11grab  -video_size
1024x768 -i :1  -c:v libx264 -preset medium -crf 28 -pix_fmt yuv420p -r 30
-g 60  -b:v 2M -maxrate 2M -bufsize 1M  -f flv rtmp://
or.pscp.tv:80/x/avadqqzw8nyv

ffmpeg version N-89400-g5a412a5c3c-static https://johnvansickle.com/ffmpeg/
Copyright (c) 2000-2017 the FFmpeg developers

  built with gcc 6.4.0 (Debian 6.4.0-7) 20170920

  configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gray --enable-libfribidi --enable-libass
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband
--enable-librtmp --enable-libsoxr --enable-libspeex --enable-libvorbis
--enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxvid --enable-libzimg

  libavutil      56.  5.100 / 56.  5.100

  libavcodec     58.  6.102 / 58.  6.102

  libavformat    58.  2.103 / 58.  2.103

  libavdevice    58.  0.100 / 58.  0.100

  libavfilter     7.  7.100 /  7.  7.100

  libswscale      5.  0.101 /  5.  0.101

  libswresample   3.  0.101 /  3.  0.101

  libpostproc    55.  0.100 / 55.  0.100

[x11grab @ 0xc3e16a0] 16 bits per pixel screen is not implemented. Update
your FFmpeg version to the newest one from Git. If the problem still
occurs, it means that your file has a feature which has not been
implemented.

Input #0, x11grab, from ':1':

  Duration: N/A, start: 1512953527.229525, bitrate: N/A

    Stream #0:0: Video: rawvideo (RGB[16] / 0x10424752), rgb565le,
1024x768, 29.97 fps, 29.97 tbr, 1000k tbn, 1000k tbc

Stream mapping:

  Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))

Press [q] to stop, [?] for help

[swscaler @ 0xc3fc320] Warning: data is not aligned! This can lead to a
speed loss

[libx264 @ 0xc3e9a80] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2
AVX FMA3 BMI2 AVX2

[libx264 @ 0xc3e9a80] profile High, level 3.1

[libx264 @ 0xc3e9a80] 264 - core 152 r19 ba24899 - H.264/MPEG-4 AVC codec -
Copyleft 2003-2017 - 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=1 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=60 keyint_min=6 scenecut=40
intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=28.0 qcomp=0.60 qpmin=0
qpmax=69 qpstep=4 vbv_maxrate=2000 vbv_bufsize=1000 crf_max=0.0
nal_hrd=none filler=0 ip_ratio=1.40 aq=1:1.00

Output #0, flv, to 'rtmp://or.pscp.tv:80/x/avadqqzw8nyv':

  Metadata:

    encoder         : Lavf58.2.103

    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p,
1024x768, q=-1--1, 2000 kb/s, 30 fps, 1k tbn, 30 tbc

    Metadata:

      encoder         : Lavc58.6.102 libx264

    Side data:

      cpb: bitrate max/min/avg: 2000000/0/2000000 buffer size: 1000000
vbv_delay: -1

[flv @ 0xc3e88a0] Failed to update header with correct duration.ate=
6.9kbits/s speed=0.967x

[flv @ 0xc3e88a0] Failed to update header with correct filesize.

frame= 1232 fps=5.0 q=27.0 Lsize=     206kB time=00:04:02.46 bitrate=
7.0kbits/s speed=0.989x

video:182kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 13.385370%

[libx264 @ 0xc3e9a80] frame I:21    Avg QP: 9.37  size:  6657

[libx264 @ 0xc3e9a80] frame P:308   Avg QP:24.69  size:    51

[libx264 @ 0xc3e9a80] frame B:903   Avg QP:33.97  size:    33

[libx264 @ 0xc3e9a80] consecutive B-frames:  1.7%  0.0%  5.1% 93.2%

[libx264 @ 0xc3e9a80] mb I  I16..4: 81.2% 14.9%  4.0%

[libx264 @ 0xc3e9a80] mb P  I16..4:  0.0%  0.0%  0.0%  P16..4:  0.1%  0.0%
0.0%  0.0%  0.0%    skip:99.9%

[libx264 @ 0xc3e9a80] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  0.0%  0.0%
0.0%  direct: 0.0%  skip:100.0%  L0:41.8% L1:58.2% BI: 0.0%

[libx264 @ 0xc3e9a80] 8x8 transform intra:14.9% inter:7.9%

[libx264 @ 0xc3e9a80] coded y,uvDC,uvAC intra: 2.4% 2.8% 1.4% inter: 0.0%
0.0% 0.0%

[libx264 @ 0xc3e9a80] i16 v,h,dc,p: 96%  3%  1%  0%

[libx264 @ 0xc3e9a80] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7% 89%  4%  0%  0%
0%  0%  0%  0%

[libx264 @ 0xc3e9a80] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 51% 12%  3%  3%
4%  2%  3%  2%

[libx264 @ 0xc3e9a80] i8c dc,h,v,p: 95%  3%  2%  0%

[libx264 @ 0xc3e9a80] Weighted P-Frames: Y:0.0% UV:0.0%

[libx264 @ 0xc3e9a80] ref P L0: 92.5%  2.0%  4.1%  1.4%

[libx264 @ 0xc3e9a80] ref B L0: 33.3% 64.7%  2.0%

[libx264 @ 0xc3e9a80] ref B L1: 93.8%  6.2%

[libx264 @ 0xc3e9a80] kb/s:6.10



Thanks again and in advance!

Kind regards, Guilherme

On Sun, Dec 10, 2017 at 8:27 PM, Lou Logan <lou at lrcd.com> wrote:

> On Sun, Dec 10, 2017, at 10:22 AM, Guilherme Santos wrote:
> > Hello, I was wondering why this command couldn't work... I'm trying to
> > live
> > stream from my aws ubuntu to periscope. check this out:
> >
> > $ ffmpeg -threads 0 -y -v verbose -re -f x11grab -video_size 1024x768 -i
> > :1
> > -c:v libx264 -preset ultrafast -crf 3 -c:a aac -b:a 64k -pix_fmt yuv420p
> > -r
> > 15 -g 30 -b:v 2500k -bufsize 512k -f flv
> > rtmp://or.pscp.tv:80/x/bb1hmhk85d71
>
> Remove "-threads 0" input option.
>
> Remove "-re" input option. It should not be used with x11grab. From the
> documentation: "Should not be used with actual grab devices or live
> input streams (where it can cause packet loss)."
>
> Replace "-r 15" output option with "-framerate 15" input option. Verify
> that the video service accepts 15 fps (I'm not sure if it will or not).
> If not, use a more standard rate, such as 25, and adjust "-g" to be
> approximately double your frame rate.
>
> Remove "-crf 3". That's overkill for streaming and is mutually exclusive
> with "-b:v".
>
> Add "-maxrate" option.
>
> Change "-bufsize" to be 1-2x "-maxrate".
>
> Experiment with -b:v, -bufsize, -maxrate to see what works best for you.
>
> > ffmpeg version 2.4.3-1ubuntu1~trusty6 Copyright (c) 2000-2014 the FFmpeg
> > developers
>
> Ancient and unsupported. Please update. An easy solution is to use a
> static build from:
> http://johnvansickle.com/ffmpeg/
>
> (I can't recall if x11grab is supported by these builds, but I'll assume
> it is.)
> _______________________________________________
> 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".




-- 
Abraço,
  Guilherme Santos


More information about the ffmpeg-user mailing list