Johnny
Johnny

Reputation: 319

Simple RTMP webcam script?

Okay I have a rtmp server is there a simple webcam script which I can use to broadcast a webcam to this server I have tried numerous scripts found online however these don't work. I have also asked questions on these scripts I have found online through this forum however haven't had any luck resolving the issues I had with them. Basically I'm after a script which allows a user to broadcast their webcam to an RTMP server. I can provide a rtmp address to test out the script if you can provide one.

Thankyou for any help

Upvotes: 2

Views: 586

Answers (1)

VC.One
VC.One

Reputation: 15881

If you have FFMPEG installed on your computer...

Here is a quick Windows guide (VFW capture method) :
http://ffmpeg.gusari.org/viewtopic.php?f=25&t=13
If you get a list (first code) with device availble and then it also makes an MP4 test file (second code) then you are ready.

However they recommend using DShow instead of VFW:
see: https://trac.ffmpeg.org/wiki/DirectShow

If you run ffmpeg -list_devices true -f dshow -i dummy in the command prompt you will get a list of devices. One those listed should say "something camera". example output looks like:
[dshow @ 03ACF580] "Integrated Camera"

Test that "Integrated Camera" with this command:
ffmpeg -f dshow -i video="Integrated Camera" out.mp4

Use a command like this below to send to RTMP server (you must be logged in there too)

ffmpeg -f dshow -i video="Integrated Camera" -acodec aac -ac 2 -strict experimental -ab 160k -vcodec libx264 -preset slow -profile:v baseline -level 30 -maxrate 10000000 -bufsize 10000000 -b 1000k -f flv rtmp://yourRTMPServer/Type/yourStreamName

replace Type in the link with your stream type (eg: live or VOD or Play or whatever your full RTMP link is written. You did not say so I can only guess its one of these three types).

Upvotes: 1

Related Questions