[FFmpeg-user] ffmpeg streaming to rtmps fails on Mac

Nam Giang kyng at ece.ubc.ca
Wed Jun 5 22:52:35 EEST 2019


And this is the full log if using the compiled snapshot:

./ffmpeg -v verbose -f avfoundation -r 29.97 -s 1280x720 -i "0:0" -preset
ultrafast -vcodec libx264 -tune zerolatency -acodec aac -f flv "rtmps://
live-api-s.facebook.com:443/rtmp/146135623219895?s_bl=1&s_sml=0&s_sw=0&s_vt=api-s&a=Abw94F0JKzBezZxd
"
ffmpeg version N-93960-g4ef0bea292 Copyright (c) 2000-2019 the FFmpeg
developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  configuration: --prefix=/Users/steve/bin --enable-libx264 --enable-gpl
--enable-gnutls
  libavutil      56. 28.100 / 56. 28.100
  libavcodec     58. 52.102 / 58. 52.102
  libavformat    58. 27.103 / 58. 27.103
  libavdevice    58.  7.100 / 58.  7.100
  libavfilter     7. 55.100 /  7. 55.100
  libswscale      5.  4.101 /  5.  4.101
  libswresample   3.  4.100 /  3.  4.100
  libpostproc    55.  4.100 / 55.  4.100
[avfoundation @ 0x7fcb19801200] Selected pixel format (yuv420p) is not
supported by the input device.
[avfoundation @ 0x7fcb19801200] Supported pixel formats:
[avfoundation @ 0x7fcb19801200]   uyvy422
[avfoundation @ 0x7fcb19801200]   yuyv422
[avfoundation @ 0x7fcb19801200]   nv12
[avfoundation @ 0x7fcb19801200]   0rgb
[avfoundation @ 0x7fcb19801200]   bgr0
[avfoundation @ 0x7fcb19801200] Overriding selected pixel format to use
uyvy422 instead.
Input #0, avfoundation, from '0:0':
  Duration: N/A, start: 16192004.320159, bitrate: N/A
    Stream #0:0: Video: rawvideo, 1 reference frame (UYVY / 0x59565955),
uyvy422, 1280x720, 15 tbr, 1000k tbn, 1000k tbc
    Stream #0:1: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
[tcp @ 0x7fcb18d5aa40] Starting connection attempt to 157.240.3.1 port 443
[tcp @ 0x7fcb18d5aa40] Successfully connected to 157.240.3.1 port 443
[rtmps @ 0x7fcb18d5c640] Cannot open connection tls://
live-api-s.facebook.com:443
rtmps://
live-api-s.facebook.com:443/rtmp/146135623219895?s_bl=1&s_sml=0&s_sw=0&s_vt=api-s&a=Abw94F0JKzBezZxd:
Resource temporarily unavailable

On Wed, Jun 5, 2019 at 12:50 PM Nam Giang <kyng at ece.ubc.ca> wrote:

> Hi there,
>
> Here is the full log (stream key is for a test user so feel free to run
> the command as is):
>
> ffmpeg -v verbose -f avfoundation -r 29.97 -s 1280x720 -i "0:0" -preset
> ultrafast -vcodec libx264 -tune zerolatency -acodec aac -f flv "rtmps://
> live-api-s.facebook.com:443/rtmp/146135623219895?s_bl=1&s_sml=0&s_sw=0&s_vt=api-s&a=Abw94F0JKzBezZxd
> "
> ffmpeg version 3.4-tessus Copyright (c) 2000-2017 the FFmpeg developers
>   built with Apple LLVM version 8.0.0 (clang-800.0.42.1)
>   configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg
> --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl
> --enable-libass --enable-libbluray --enable-libfreetype --enable-libgsm
> --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb
> --enable-libopencore-amrwb --enable-libopus --enable-libsnappy
> --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab
> --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
> --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs
> --enable-libxvid --enable-libzmq --enable-libzvbi --enable-version3
> --pkg-config-flags=--static --disable-ffplay
>   libavutil      55. 78.100 / 55. 78.100
>   libavcodec     57.107.100 / 57.107.100
>   libavformat    57. 83.100 / 57. 83.100
>   libavdevice    57. 10.100 / 57. 10.100
>   libavfilter     6.107.100 /  6.107.100
>   libswscale      4.  8.100 /  4.  8.100
>   libswresample   2.  9.100 /  2.  9.100
>   libpostproc    54.  7.100 / 54.  7.100
> [avfoundation @ 0x7fee8e001600] Selected pixel format (yuv420p) is not
> supported by the input device.
> [avfoundation @ 0x7fee8e001600] Supported pixel formats:
> [avfoundation @ 0x7fee8e001600]   uyvy422
> [avfoundation @ 0x7fee8e001600]   yuyv422
> [avfoundation @ 0x7fee8e001600]   nv12
> [avfoundation @ 0x7fee8e001600]   0rgb
> [avfoundation @ 0x7fee8e001600]   bgr0
> [avfoundation @ 0x7fee8e001600] Overriding selected pixel format to use
> uyvy422 instead.
> Input #0, avfoundation, from '0:0':
>   Duration: N/A, start: 16191833.320295, bitrate: N/A
>     Stream #0:0: Video: rawvideo, 1 reference frame (UYVY / 0x59565955),
> uyvy422, 1280x720, 15 tbr, 1000k tbn, 1000k tbc
>     Stream #0:1: Audio: pcm_f32le, 44100 Hz, stereo, flt, 2822 kb/s
> Stream mapping:
>   Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
>   Stream #0:1 -> #0:1 (pcm_f32le (native) -> aac (native))
> Press [q] to stop, [?] for help
> [graph_1_in_0_1 @ 0x7fee8d45df60] tb:1/44100 samplefmt:flt
> samplerate:44100 chlayout:0x3
> [format_out_0_1 @ 0x7fee8d460600] auto-inserting filter 'auto_resampler_0'
> between the filter 'Parsed_anull_0' and the filter 'format_out_0_1'
> [auto_resampler_0 @ 0x7fee8d4613e0] ch:2 chl:stereo fmt:flt r:44100Hz ->
> ch:2 chl:stereo fmt:fltp r:44100Hz
> [graph 0 input from stream 0:0 @ 0x7fee8d70d300] w:1280 h:720
> pixfmt:uyvy422 tb:100/2997 fr:2997/100 sar:0/1 sws_param:flags=2
> [auto_scaler_0 @ 0x7fee8d734980] w:iw h:ih flags:'bicubic' interl:0
> [format @ 0x7fee8d7344a0] auto-inserting filter 'auto_scaler_0' between
> the filter 'Parsed_null_0' and the filter 'format'
> [auto_scaler_0 @ 0x7fee8d734980] w:1280 h:720 fmt:uyvy422 sar:0/1 ->
> w:1280 h:720 fmt:yuv422p sar:0/1 flags:0x4
> [libx264 @ 0x7fee8e00a000] using cpu capabilities: MMX2 SSE2Fast SSSE3
> SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
> [libx264 @ 0x7fee8e00a000] profile High 4:2:2, level 3.1, 4:2:2 8-bit
> [libx264 @ 0x7fee8e00a000] 264 - core 148 - H.264/MPEG-4 AVC codec -
> Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=0
> ref=1 deblock=0:0:0 analyse=0:0 me=dia subme=0 psy=1 psy_rd=1.00:0.00
> mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=0 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=0 keyint=250 keyint_min=25 scenecut=0
> intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69
> qpstep=4 ip_ratio=1.40 aq=0
> Output #0, flv, to 'rtmps://
> live-api-s.facebook.com:443/rtmp/146135623219895?s_bl=1&s_sml=0&s_sw=0&s_vt=api-s&a=Abw94F0JKzBezZxd
> ':
>   Metadata:
>     encoder         : Lavf57.83.100
>     Stream #0:0: Video: h264 (libx264), 1 reference frame ([7][0][0][0] /
> 0x0007), yuv422p, 1280x720, q=-1--1, 29.97 fps, 1k tbn, 29.97 tbc
>     Metadata:
>       encoder         : Lavc57.107.100 libx264
>     Side data:
>       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
>     Stream #0:1: Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz,
> stereo, fltp, delay 1024, 128 kb/s
>     Metadata:
>       encoder         : Lavc57.107.100 aac
> ^C[tls @ 0x7fee8d53a720] IO Error: -9806
> av_interleaved_write_frame(): Input/output error
> [flv @ 0x7fee8d85f000] Failed to update header with correct duration.
> [flv @ 0x7fee8d85f000] Failed to update header with correct filesize.
> Error writing trailer of rtmps://
> live-api-s.facebook.com:443/rtmp/146135623219895?s_bl=1&s_sml=0&s_sw=0&s_vt=api-s&a=Abw94F0JKzBezZxd:
> Input/output error
> frame=    3 fps=0.3 q=26.0 Lsize=     284kB time=00:00:00.18
> bitrate=12509.4kbits/s speed=0.0195x
> video:300kB audio:3kB subtitle:0kB other streams:0kB global headers:0kB
> muxing overhead: unknown
> Input file #0 (0:0):
>   Input stream #0:0 (video): 3 packets read (5537280 bytes); 3 frames
> decoded;
>   Input stream #0:1 (audio): 16 packets read (65536 bytes); 16 frames
> decoded (8192 samples);
>   Total: 19 packets (5602816 bytes) demuxed
> Output file #0 (rtmps://
> live-api-s.facebook.com:443/rtmp/146135623219895?s_bl=1&s_sml=0&s_sw=0&s_vt=api-s&a=Abw94F0JKzBezZxd
> ):
>   Output stream #0:0 (video): 3 frames encoded; 3 packets muxed (306909
> bytes);
>   Output stream #0:1 (audio): 8 frames encoded (8192 samples); 9 packets
> muxed (3164 bytes);
>   Total: 12 packets (310073 bytes) muxed
> [libx264 @ 0x7fee8e00a000] frame I:1     Avg QP:20.00  size:202348
> [libx264 @ 0x7fee8e00a000] frame P:2     Avg QP:26.00  size: 51984
> [libx264 @ 0x7fee8e00a000] mb I  I16..4: 100.0%  0.0%  0.0%
> [libx264 @ 0x7fee8e00a000] mb P  I16..4: 53.0%  0.0%  0.0%  P16..4: 42.5%
>  0.0%  0.0%  0.0%  0.0%    skip: 4.5%
> [libx264 @ 0x7fee8e00a000] coded y,uvDC,uvAC intra: 83.8% 98.3% 90.4%
> inter: 46.0% 89.5% 38.6%
> [libx264 @ 0x7fee8e00a000] i16 v,h,dc,p: 19% 13% 55% 13%
> [libx264 @ 0x7fee8e00a000] i8c dc,h,v,p: 56% 12% 19% 13%
> [libx264 @ 0x7fee8e00a000] kb/s:24480.70
> [aac @ 0x7fee8d891c00] Qavg: 268.360
> Exiting normally, received signal 2.
>
> On Tue, Jun 4, 2019 at 5:52 PM Micael Silva <micaelsilva at gmail.com> wrote:
>
>> On Tue, Jun 4, 2019 at 6:40 PM Nam Giang <kyng at ece.ubc.ca> wrote:
>>
>> > Hi there,
>> >
>> > Is there anyone success with streaming to rtmps destination using
>> ffmpeg on
>> > a Mac? (Facebook recently enforces this to be the only protocol they
>> > support)
>> >
>> > My try:
>> >
>> > > ffmpeg -v verbose -f avfoundation -r 29.97 -s 1280x720 -i "0:0"
>> -preset
>> > ultrafast -vcodec libx264 -tune zerolatency -f flv "rtmps://
>> > live-api-s.facebook.com:443/rtmp/<stream_key>"
>> >
>> > It always stale after a sec. On FB it said it hasn't received the data
>> for
>> > some time.
>> >
>> > Using the nightly build at ffmpeg.org. Error looks like:
>> >
>> > [tls @ 0x7f8c8cf1b720] IO Error: -9806
>> >
>> > I tried to build it myself with gnutls and still no luck:
>> >
>> > [tcp @ 0x7f7f89c5d3c0] Starting connection attempt to 157.240.3.1 port
>> 443
>> > [tcp @ 0x7f7f89c5d3c0] Successfully connected to 157.240.3.1 port 443
>> > [rtmps @ 0x7f7f89c40000] Cannot open connection tls://
>> > live-api-s.facebook.com:443
>> >
>> > Resource temporarily unavailable
>> >
>> > Thanks
>> >
>>
>> Complete uncut output missing
>> _______________________________________________
>> ffmpeg-user mailing list
>> ffmpeg-user at ffmpeg.org
>> https://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