Using JPEG files as input for streaming MJPEG

About encoding, codec settings, muxers and filter usage
jacomoman
New Cone
New Cone
Posts: 5
Joined: 05 Aug 2008 02:23

Using JPEG files as input for streaming MJPEG

Postby jacomoman » 05 Aug 2008 02:49

Hi folks,

I did several searches on the subject and couldn't find an answer to this question.

Is VLC capable of taking a plain JPEG file in some directory as input and streaming out as a MJPEG stream? More info... I have another process that's running and will be generating a JPEG file (let's call it capture.jpg) on regular intervals. This process will write capture.jpg to a dir, let's say /tmp/capture, something like 5 times a second. Is it possible for me to start VLC as another process, give it the path to /tmp/capture/capture.jpg and just have it stream that file out as a MJPEG stream?

In VLC player there is a "Open Directory..." off the main menu, but there is no option for streaming anything found in that directory, or maybe I'm looking at the wrong feature or something. Anyways, I'd very much appreciate someone replying to me on this.

Thank you in advance.

-Jac

tigershark
New Cone
New Cone
Posts: 3
Joined: 04 Aug 2008 18:57

Re: Using JPEG files as input for streaming MJPEG

Postby tigershark » 05 Aug 2008 20:01

I succeded in sending a MJPEG stream using a webserver that dinamically refreshed the image at the desired frame rate.
This webserver was included in the network camera, but i had to find the correct url because this feature was undocumented (damned ActiveX camera controls :evil: ).
Fortunately there was also a jar control that was....easier to understand :P

This was the command line I used for the MJPEG streaming:

vlc http://192.168.104.103:8000/image?speed=10 --sout "#transcode:rtp" --sout-transcode-vcodec="mp4v" --sout-transcode-vb="192" --sout-transcode-scale="1" --sout-rtp-dst="192.168.104.139" --sout-rtp-port-video="5002" --sout-rtp-ttl="127" --sout-rtp-sdp="file://C:\Program Files\Darwin Streaming Server\Movies\2.sdp"

If you can write a CGI or a dynamic web page that refreshes the jpeg image you should solve your problem quite easily. :D

Flostim
New Cone
New Cone
Posts: 1
Joined: 09 Aug 2008 13:38

Re: Using JPEG files as input for streaming MJPEG

Postby Flostim » 09 Aug 2008 13:44

@tigershark:

which vlc version did you use? I coudln't get your command line working right.

As an example I used this webcam: http://www.volgograd.ru/webcam/campic.p3?id=1.

with your code the streaming stopped after a few secs. When I added --loop it restarted every second but in both cases i coudln't get it to play in VLC on the receiving machine.


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 10 guests