Closed Eruditionis closed 2 years ago
enable the option for ffmpeg debug and attempt to start the stream. this will give more detailed error messages from the ffmpeg command it's own logging file in the logging section of OctoPrint.
Done, I got video but it is giving me an error saying there isn't enough of it being sent to maintain a smooth stream. It is buffering for a minute then has sped up video, also appears to be stretched out as seen if you click this link https://youtu.be/vQ8fdBm6qXY, hopefully it's still going when you get this. I will also link the rtmpstreamer log below for you in case it helps?
On Mon, Mar 14, 2022 at 8:47 PM jneilliii @.***> wrote:
enable the option for ffmpeg debug and attempt to start the stream. this will give more detailed error messages from the ffmpeg command it's own logging file in the logging section of OctoPrint.
— Reply to this email directly, view it on GitHub https://github.com/jneilliii/OctoPrint-RTMPStreamer/issues/44#issuecomment-1067448067, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYHGJM2P4VETHWFK2TYUAHTU77M3JANCNFSM5QXBF47A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you authored the thread.Message ID: @.***>
The stretch is cause you aren't setting the size to the aspect of your camera, make sure you know the natural aspect of your cam when you set the stream size.
As for buffering remember you're limited by hardware or network if you're on a Pi via Wifi, that's some heavy restrictions and YouTube requires a very heavy stream to be happy.
Thought honestly your stream looks really good
Maybe it's me being very picky, I appreciate it! How do I tell the size of my camera? Some streams come out good, some are stretched. Maybe just restart it until it works?
On Tue, Mar 15, 2022 at 10:07 AM Justin F. Hallett @.***> wrote:
The stretch is cause you aren't setting the size to the aspect of your camera, make sure you know the natural aspect of your cam when you set the stream size.
As for buffering remember you're limited by hardware or network if you're on a Pi via Wifi, that's some heavy restrictions and YouTube requires a very heavy stream to be happy.
Thought honestly your stream looks really good.
— Reply to this email directly, view it on GitHub https://github.com/jneilliii/OctoPrint-RTMPStreamer/issues/44#issuecomment-1068029395, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYHGJM3PDWWK5Y5WRCRDWE3VACKRJANCNFSM5QXBF47A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
Also, I am using a Ethernet cable, before I got flawless videos(just a little grainy), but I have been streaming for 40 minutes and only have about 15 minutes worth of video
I'm doing more work on the setup to enable HW encoders which will help a lot. Right now it's using SW encoders.
As for video size are you on a Pi?
Yes, I have a rpi 4B with this camera https://www.amazon.com/Raspberry-Camera-Webcam-OV5647-Adjustment/dp/B08QFM8TVV/ref=sr_1_5?crid=Z3040ITF7LEX&keywords=camera+raspberry+pi&qid=1647354231&sprefix=camera+raspberry+pi%2Caps%2C64&sr=8-5
On Tue, Mar 15, 2022 at 10:22 AM Justin F. Hallett @.***> wrote:
I'm doing more work on the setup to enable HW encoders which will help a lot. Right now it's using SW encoders.
As for video size are you on a Pi?
— Reply to this email directly, view it on GitHub https://github.com/jneilliii/OctoPrint-RTMPStreamer/issues/44#issuecomment-1068045209, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYHGJM27KNP2O22CPNOHWJDVACMIZANCNFSM5QXBF47A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
When I set mine up I use this chart if using a pi with picamera
https://picamera.readthedocs.io/en/release-1.12/fov.html
then you setup the octopi.txt file in /boot to have the same settings that you want form that chart. And in rmtpstreamer make sure you use the same settings.
make sure you give yourself enough gpu_mem in config.txt as well as this is very gpu intense
So should I ssh into the pi to change that value? How much should I give for reference? I'm very new to this
There are soooo many factors to answer that, I'd start with 128 and move up from there.
I have 128 automatically assigned, so I will bump it up to 256
On Tue, Mar 15, 2022 at 11:15 AM Justin F. Hallett @.***> wrote:
There are soooo many factors to answer that, I'd start with 128 and move up from there.
— Reply to this email directly, view it on GitHub https://github.com/jneilliii/OctoPrint-RTMPStreamer/issues/44#issuecomment-1068107072, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYHGJM7VGT3YS6MWGZQZBEDVACSR3ANCNFSM5QXBF47A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
I think 256 is what I typically put in that setting.
Okay, I just changed the setting, I will sudo reboot my pi when it is done with it's current print job. Will update as soon as possible!
On Tue, Mar 15, 2022 at 12:41 PM jneilliii @.***> wrote:
I think 256 is what I typically put in that setting.
— Reply to this email directly, view it on GitHub https://github.com/jneilliii/OctoPrint-RTMPStreamer/issues/44#issuecomment-1068206395, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYHGJMZ7WQIJNIQXG4BDKRTVAC4STANCNFSM5QXBF47A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
256 yields the same results, should I bump it up again? For 2 min of stream time, only <15 seconds of footage was sent out
turn off the overlay, it will slow things down as it needs to process each frame, see if that helps.
The overlay is off, restarted live stream, no overlay in the video, but the output is still just as bad. If I hadn't had really good streams just a week ago, I would guess my wifi is bad, but I had really good streams on this wifi not long ago
what are you setting your bitrate to? the default is 700k and that is really small for YouTube, I forget all the info but they have a help page listing what it should be based on stream res
Remember the plug just gives you the tools, the setup might need to be googled a bit, I'm no pro with YouTube I found it to be very difficult and lacking so I use Twitch.
i'm not sure where to find the bitrate to change that, is it in one of the config files? Or can I find it in octoprint?
Could very well be Youtube, I am going to try it on Facebook, and if no beans there then I will use twitch.
My guess is that the bitrate is 700, because I have no idea where it is so no changes to it
it's in the advanced features under ffmpeg in the plugin config.
I'd post a screen shot but don't have onto at work ;)
That's fine, I am also at work lol, that's the only time I have access to the printer (I work at a library)
I will see if I can change that, should I change anything else in that area? I notice there are a bunch of options labeled for experts only
It's there for those that know ffmpeg to have more granular control. So feel free but I'd read first ;)
The big thing with YouTube is getting the amount of data it wants, that being said the old version of the plugin was using 700k as well, none of that changed, the big change with the overlay, which is why I suggested we remove it. Since it's acting the same I'm very curious what the issue is, I just don't know enough about YouTube but I know it's been a pain.
I plan to work more on the plugin very soon I'll try and focus some attention on YouTube maybe I can change some default settings if it's set to YouTube if Ic an find what the issue with it is.
Okay, so I just changed the setting to Youtube's recommended bitrate of 4500K and still have buffering. Funny enough it is actually much worse now...
Yeah I can try other ways to stream, our thing is to provide our patrons with the ability to watch their prints as they progress, so it doesn't matter where it streams to as long as it streams lol.
I really appreciate all this help though, I do plan on contributing to the plugin, this is one of my most used plugins
looks like they want keyframes which I'm not setting in the plugin give me a few minutes to hash out the string of it and I'll send you something to try.
Okay that works! Thank you so much for all of this
in the experimental
can you try to replace this part -vb {bitrate}
with -b:v {bitrate} -maxrate {bitrate} -minrate {bitrate} -bufsize {bitrate}
Remember if you make changes there when a new version is released it won't change that, you'll need to remember to click the resend button on that filed to reset it. And this is just a test, I can't test it currently :)
Should I reboot the rpi once making that change? I added that line in and pressed save
no saving and restarting the stream is good enough
Okay, got it, gonna start up the stream again and update in a minute or two
So I am getting the same issue, buffering with 1-3 seconds of video in between buffers.
I had this set up to run through docker before and had the video running, only issue was that I couldn't start the stream through the plugin. Do you think that route would be easier or should we stick with this?
docker would add a layer, the only difference would be the string that starts ffmpeg if you can extract what you had for your string I could tell you how to setup the plugin to work the same.
I'm not sure if this detail matters, but when I do get video, it's very sped up.
it's just catching up, it's using UDP so there is no frame order.
what docker image were you using before I'll have a look at it and extract how it was running ffmpeg for you.
How would I extract that? I believe it was the most recent one, using the directions in the prerequisites link on the setup page
Just checked, I didn't reinstall docker since I reimaged the pi, will install now and update in a few mins
one sec I'll check the docs
this is the image, and the command is at the bottom of the page
reset the ffmpeg command first then
try to replace {videocodec}
with h264
Server: Docker Engine - Community Engine: Version: 20.10.13 API version: 1.41 (minimum version 1.12) Go version: go1.16.15 Git commit: 906f57f Built: Thu Mar 10 14:05:46 2022 OS/Arch: linux/arm Experimental: false containerd: Version: 1.5.10 GitCommit: 2a1d4dbdb2a1030dc5b01e96fb110a9d9f150ecc runc: Version: 1.0.3 GitCommit: v1.0.3-0-gf46b6ba docker-init: Version: 0.19.0 GitCommit: de40ad0
I finished installing docker, I also had it pull kolisko/rpi-ffmpeg:latest
How do I reset the ffmpeg command?
I replaced that.
When I put that command in, I get this: (I didn't leave the xxxx-xxxx's in there)
docker run -it --rm --privileged adilinden/ffmpeg ffmpeg \ -re -f mjpeg -framerate 5 -i http://192.168.1.16:8080/?action=stream \ -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -acodec aac -ab 128k \ -strict experimental -vcodec h264 -pix_fmt yuv420p -g 10 -vb 700k -framerate 5 \ -f flv rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx Unable to find image 'adilinden/ffmpeg:latest' locally docker: Error response from daemon: pull access denied for adilinden/ffmpeg, repository does not exist or may require 'docker login': denied: requested access to the resource is denied. See 'docker run --help'.
you can't replace it with that.
there is a button right beside the title. Also if you ran that you'll need to reboot now.
I just rebooted the pi, I thought it failed when I tried running that command?
I meant that I replaced the {videocodec} with h264
that's cause you are running it with docker, don't use docker.
Okay, I’ll shut off docker my bad, will run again when I’m back at work tomorrow and let you know ツ
On Wed, Mar 16, 2022 at 4:58 PM Justin F. Hallett @.***> wrote:
that's cause you are running it with docker, don't use docker.
— Reply to this email directly, view it on GitHub https://github.com/jneilliii/OctoPrint-RTMPStreamer/issues/44#issuecomment-1069625629, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYHGJM25XRN3NLLRHQXUQVLVAJDNVANCNFSM5QXBF47A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
You are receiving this because you are subscribed to this thread.Message ID: @.***>
I wasn't getting the plugin to work through octoprint, after emailing Jneilliii I figured out docker was my issue. Now, when I enable the stream through docker, I get enough to start the stream via YouTubeLive, but it's only a snapshot. I get no video.
I am using FFmpeg for streaming, settings/fails in pics
When I used docker I could get test video, but no output from the plugin, now that docker is gone, I have output from the plugin, but no video :/