Record Live Stream & Transcoding using VLC Plugin
Posted: 04 Nov 2008 19:29
Hi, I am trying to record a live stream using the Mozilla Plugin (0.9.4) , HTML and Javascript . I want to be able to view the video that is been recorded while is recorded and I also want the recorded video to be transcoded to mpg2 format.
The problem that I am having is that while I can record the stream to hard drive, i can not seem to be able to change the recording settings, and the recorded movies are very large (close to 1 GB for 15 minutes).
Using the standalone version of the VLC Media Player, I was able to generate a command string that does the recording, the preview, and the transcoding, and it also seems to workwhen used with the command line. The generated string looked similar to this:
I have tried various methods of providing a similar string to the VLC plugin but most of them do not record anything or if they record, the file size is huge. So my problem is not knowing how to pass the same parameters to the VLC plugin component.
For example setting the options using Javascript like this does not work at all:
The simplified version of my code looks like this. It records, but regardless of setting I use for the "vb=3072", the file size is always the same, so I am thinking that the transcode parameters are not been used at all.
Anyway, any advice or help will be greatly appreciated. Have a great day!
Thanks.
A.
The problem that I am having is that while I can record the stream to hard drive, i can not seem to be able to change the recording settings, and the recorded movies are very large (close to 1 GB for 15 minutes).
Using the standalone version of the VLC Media Player, I was able to generate a command string that does the recording, the preview, and the transcoding, and it also seems to workwhen used with the command line. The generated string looked similar to this:
Code: Select all
:sout=#transcode{vcodec=mp2v,vb=3072,scale=1,acodec=mpga,ab=128,channels=2}:duplicate{dst=display,dst=std{access=file,mux=ps,dst="C:\VLC\myTestMovie.MPG"}}
For example setting the options using Javascript like this does not work at all:
Code: Select all
var options = "sout=#transcode{vcodec=mp2v,vb=3072,scale=1,acodec=mpga,ab=128,channels=2}:duplicate{dst=display,dst=std{access=file,mux=ps,dst=C:\VLC\myTestMovie.MPG";
Code: Select all
function record()
{
var oVlc = document.getElementById("vlc1");
var mrl = "udp://@239.1.1.1:4444";
var options = ":sout=#transcode{vcodec=mp2v,vb=3072,scale=1,acodec=mpga,ab=128,channels=2} :sout=#duplicate{dst=display,dst=std{access=file,mux=ps,dst=C:\\VLC\\media\\myTestMovie.mpg";
var vId = oVLc.playlist.add(mrl, "vlc1", options);
ovlc.playlist.playItem(vId);
}
Thanks.
A.