steveseguin / raspberry_ninja

Publish or capture VDO.Ninja streams with Python (Raspberry Pi, Linux, Mac, Windows WSL)
https://raspberry.ninja
144 stars 28 forks source link

VDO Ninja into WSL error stream rtmp from youtube #44

Closed sky7176 closed 2 weeks ago

sky7176 commented 2 weeks ago

I installed it on both a physical machine and a WSL environment, if I run this command: python3 publish.py --test --bitrate 6000

everything works, from my browser I see the stream

but if I try to launch this command: python3 publish.py --rtmp rtmp://a.rtmp.youtube.com/live2/[Personal Key] --test --bitrate 6000

I get, on both machines, this error:

gst-launch-1.0 videotestsrc ! video/x-raw,width=(int)1920,height=(int)1080,type=video,framerate=(fraction)30/1 ! videoconvert ! queue max-size-buffers=10 ! vp8enc deadline=1 target-bitrate=6000000 name="encoder" ! rtpvp8pay ! application/x-rtp,media=video,encoding-name=VP8,payload=96 ! queue ! sendrecv. audiotestsrc is-live=true wave=red-noise ! queue ! audioconvert dithering=0 ! audio/x-raw,rate=48000,channel=1 ! fdkaacenc bitrate=65536 ! audio/mpeg ! aacappear! audio/mpeg, mpegversion=4 ! queue ! sendrecv. flvmux name=sendrecv ! rtmpsink location='rtmp://a.rtmp.youtube.com/live2/z4a2-q14h-01gp-xhaw-3zvw live=1' !!! Unhandled exception !!! Type: <class 'gi.repository.GLib.GError'> Value: gst_parse_error: no element "fdkaacenc" (1) Traceback: File "/home/giuseppe/raspberry_ninja/publish.py", line 2487, in asyncio.run(main()) File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run return loop. run_until_complete(main) File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete return future.result() File "/home/giuseppe/raspberry_ninja/publish.py", line 2365, in main pipe = Gst.parse_launch(PIPELINE_DESC) File "/home/giuseppe/raspberry_ninja/publish.py", line 2487, in File "/usr/lib/python3.10/asyncio/runners.py", line 44, in run File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete File "/home/giuseppe/raspberry_ninja/publish .py", line 2365, in main giuseppe@sglaptop01:~/raspberry_ninja$

where am I wrong, because I'm definitely wrong HI.

steveseguin commented 2 weeks ago

You can update the publish.py file. I tested and there were some codec issues with the Windows WSL version; I fixed them I think.

Missing audio codecs, but I added some fallback logic to other codecs that should be available in that case.

https://github.com/steveseguin/raspberry_ninja/commit/7cb651a8f790e7eedb113b7a79d009d96f9f6491

python3 publish.py --rtmp rtmp://a.rtmp.youtube.com/live2/XXXXXXXXXXX --test --bitrate 6000

sky7176 commented 2 weeks ago

Ok many thanks, now all works fine

Giuseppe