+6
Discuss & Vote

Using VLC transcode Video RTSP stream to MJPEG

Brent Thomas 7 months ago in Media Tiles / Video Camera Feeds • updated by Terry (ActionTiles) (Co-Founder) 5 months ago 5

I posted this for another user but though I would create a topic on how I was able to access my Samsung SNH-v6410PN camera feed in action tiles using VLC.  There are a lot of variations when setting this up so this is not comprehensive to cover every camera type but hopefully it gets you most of the way there.s


To do this through VLC with my Samsung camera I took the following steps.  Before proceeding identify the url for you cameras RTSP stream - Great database to find this: 


1. Make sure you can access your cameras RTSP stream from a browser.   In the case of my samsung camera I accessed the RTSP stream with this path, rtsp://user:password@192.168.1.72/profile5/media.smp (Make sure to replace with the RTSP format for your camera (it will vary).   Note:  If camera is user/password protected you may not be able to pass the user:password in the URL when trying to access the feed.   This depends on the browser you are using.  Chrome and fully do not allow them to passed so simply enter the URL as shown below and then you should be prompted for the user name and password.  Firefox should work ok with the user:pass being passed within the URL as shown above.


2. Install VLC (im using version 2.2.8) and access VLC command line. To do this from windows open up Windows CMD prompt as administrator and navigate to you VLC directory path below.  Note:  Some VLC versions are buggy with trans-coding so thats why I reference the version of VLC I am using to do this successfully.

C:\>cd Program Files (x86)

C:\Program Files (x86)>cd VideoLAN

C:\Program Files (x86)\VideoLAN>cd VLC

C:\Program Files (x86)\VideoLAN\VLC>


3. Once there enter the command string shown below and REPLACE the part highlighted in bold with your cameras RTSP stream link.  Note: you only need to enter the user:password part of the string if you have assigned the camera a user name and password logon.  Also replace the IP address with your IP address.    After you press enter if you dont receive any errors go to step 4.


vlc.exe -R rtsp://user:password@192.168.1.72/profile5/media.smp --sout

"#transcode{vcodec=mjpg,vb=2500,scale=1.0,fps=10,acodec=none}:standard{access=http{mime=multipart/x-mixed-replace; boundary=7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:8888/videostream.cgi}


4.  Change the IP address below to the IP of the PC running VLC that is doing the transcoding.  Try to access the stream from a web browser or action tiles (only will work on your local network).    If camera is user/password protected you may not be able to pass the user:password in the URL when trying to access the feed, this depends on the browser you are using.  Chrome and fully do not allow them to passed so simply enter the URL as shown below and then you should be prompted for the user name and password. http://192.168.1.119:8888/videostream.cgi


5.  If all is successful grab yourself a Beer and celebrate :)


Hope this helps

Discuss & Vote

Thanks for providing this solution, Brent! 


There's some indication that the Android App "IP Cam Viewer Pro" (or is it "Tiny Cam Viewer..."?) can do transcoding right in the background processing of a tablet and serve it through its built-in mini-webserver.


I've yet to experience this myself, but it's the same general concept as you recommend except it bypasses the requirement for a separate PC or rPi to run VNC... For just 1 or 2 cameras.


I hope to find out if this really works soon! I have to pick up a couple RTSP output cameras... 


... Terry.

+1

Interesting I’ll have to give it a try.  I’m using ip webcam on a cisco dx80 video endpoint running Android 4.0 and outputting as an mjpeg to AT which works well.  I have tried an external ip camera through ip webcam and it may chug on that device but worth a try.

I've been experimenting with the Tinycam webserver and it is very easy to set up and it works perfectly...everywhere except AT.  


I have the server running on a Nexus 9 tablet and I can access the feed from my desktop computer and from my phone, but if I use the same URL in AT, I get nothing.   


I'm stymied and will keep working on this.  If anyone has any ideas, I'm open!

  1. What format of URL are you using? 
  2. Which browser on the Nexus 9?
+1

This is very nice, thank you Brent ! Can this be done for multiple cameras at the same time ?