MuxLabs / wocket

Example of streaming to an RTMP endpoint from a browser via WebSockets

Home Page:https://ws.mux.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FFmpeg STDERR: Conversion failed!

piavgh opened this issue · comments

Thank you for creating this repository (especially the Next.js part).

I tried to run with npm run dev, but I can not stream it to Mux.

This is the full terminal log:

> custom-server@1.0.0 dev /home/hp/Dev/Learning/webrtc/wocket
> nodemon server.js

[nodemon] 2.0.3
[nodemon] to restart at any time, enter `rs`
[nodemon] watching path(s): *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node server.js`
event - compiled successfully
> Ready on port 3000
event - build page: /
wait  - compiling...
event - compiled successfully
event - build page: /next/dist/pages/_error
wait  - compiling...
event - compiled successfully
Streaming socket connected
FFmpeg STDERR: ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  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
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100

this is some video data
this is some video data
FFmpeg STDERR: Input #0, matroska,webm, from 'pipe:':
  Metadata:
    encoder         : Chrome
  Duration: N/A, start: 
FFmpeg STDERR: 0.000000, bitrate: N/A
    Stream #0:0(eng): Video: vp8, yuv420p(progressive), 640x480, SAR 1:1 DAR 4:3, 30 fps, 30 tbr, 1k tbn, 1k tbc (default)
    Metadata:
      alpha_mode      : 1
    Stream #0:1(eng): Audio: opus, 48000 Hz, mono, fltp (default)

this is some video data
this is some video data
FFmpeg STDERR: Stream mapping:
  Stream #0:0 -> #0:0 (vp8 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (opus (native) -> aac (native))

FFmpeg STDERR: -async is forwarded to lavfi similarly to -af aresample=async=1:min_hard_comp=0.100000:first_pts=0.

FFmpeg STDERR: [libx264 @ 0x55fd332ec0c0] VBV bufsize set but maxrate unspecified, ignored
[libx264 @ 0x55fd332ec0c0] using SAR=1/1
[libx264 @ 0x55fd332ec0c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x55fd332ec0c0] profile High, level 3.0
[libx264 @ 0x55fd332ec0c0] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - 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=7 lookahead_threads=7 sliced_threads=1 slices=7 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmps://global-live.mux.com/app/779a0f71-2fb5-2b6d-3ef3-226f5a0e1a96':
  Metadata:
    encoder         : Lavf57.83.100
    Stream #0:0(eng): Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 640x480 [SAR 1:1 DAR 4:3], q=-1--1, 30 fps, 1k tbn, 30 tbc (default)
    Metadata:
      alpha_mode      : 1
      encoder         : Lavc57.107.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 1000 vbv_delay: -1
    Stream #0:1(eng): Audio: aac (LC) ([10][0][0][0] / 0x000A), 44100 Hz, mono, fltp, 64 kb/s (default)
    Metadata:
      encoder         : Lavc57.107.100 aac

this is some video data
this is some video data
this is some video data
this is some video data
this is some video data
FFmpeg STDERR: av_interleaved_write_frame(): Input/output error

FFmpeg STDERR: [flv @ 0x55fd33229020] Failed to update header with correct duration.
[flv @ 0x55fd33229020] Failed to update header with correct filesize.
Error writing trailer of rtmps://global-live.mux.com/app/779a0f71-2fb5-2b6d-3ef3-226f5a0e1a96: Input/output error

FFmpeg STDERR: frame=    3 fps=0.6 q=22.0 Lsize=      20kB time=00:00:00.34 bitrate= 477.6kbits/s speed=0.0648x    
video:21kB audio:3kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown

FFmpeg STDERR: [tls @ 0x55fd33227380] The specified session has been invalidated for some reason.

FFmpeg STDERR:     Last message repeated 1 times
[libx264 @ 0x55fd332ec0c0] frame I:1     Avg QP:14.03  size: 18659
[libx264 @ 0x55fd332ec0c0] frame P:2     Avg QP:13.83  size:   952
[libx264 @ 0x55fd332ec0c0] mb I  I16..4: 63.8%  9.4% 26.8%
[libx264 @ 0x55fd332ec0c0] mb P  I16..4: 29.6%  1.2%  0.1%  P16..4:  1.0%  0.8%  0.2%  0.0%  0.0%    skip:67.1%
[libx264 @ 0x55fd332ec0c0] 8x8 transform intra:7.3% inter:4.3%

FFmpeg STDERR: [libx264 @ 0x55fd332ec0c0] coded y,uvDC,uvAC intra: 58.2% 69.9% 57.7% inter: 0.8% 2.5% 0.6%
[libx264 @ 0x55fd332ec0c0] i16 v,h,dc,p: 33% 20% 45%  1%
[libx264 @ 0x55fd332ec0c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 12% 31% 48%  2%  0%  0%  2%  1%  3%
[libx264 @ 0x55fd332ec0c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 32% 28% 26%  1%  2%  2%  4%  2%  3%
[libx264 @ 0x55fd332ec0c0] i8c dc,h,v,p: 60% 22% 17%  1%
[libx264 @ 0x55fd332ec0c0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x55fd332ec0c0] kb/s:1644.96

FFmpeg STDERR: [aac @ 0x55fd33300b80] Qavg: 105.689

FFmpeg STDERR: Conversion failed!

FFmpeg STDIN Error { Error: write EPIPE
    at WriteWrap.afterWrite [as oncomplete] (net.js:789:14) errno: 'EPIPE', code: 'EPIPE', syscall: 'write' }
FFmpeg child process closed, code 1, signal null
shit got closed, yo

FFmpeg seems to be broken somehow.

I'm pretty sure that the FFmpeg on my system is working properly because when I tried to run this repository https://github.com/dougsillars/browserLiveStream (similar to this code, but with pure html/js and send data to https://api.video/ instead of Mux), I can see my live stream.

Do you know which might cause this problem? Thanks.

Hi there! Sorry, didn't see this sooner. Just out of curiosity, can you give me any additional system info? What OS, browser, FFmpeg version are you using? Do you see the same issue if you fork/use this on Glitch?

Hi @mmcc ,

Thank you for checking out.

My system info is:
I tested on 2 computers. Sometimes, it can run for about 20s, but most of the time, it stops right after 1 second.
1.
OS: Ubuntu 18.04
Browser: Version 83.0.4103.97 (Official Build) (64-bit)
ffmpeg: version 3.4.8-0ubuntu0.2

OS: MacOS 10.15.6
Browser: Version 83
ffmpeg: 4.3.1 via Homebrew

Do you see the same issue if you fork/use this on Glitch?
=> Will try to do when I get home

got the same error here.

I've crawled through multiple websocket > ffmpeg > rtmp guides and have come up short as well

There was a pretty big release last week, can anyone see if they can still reproduce this?