lundi 26 septembre 2016

Syntax to transcode and stream video to stdout?

I'm trying to transcode and stream video from VLC to stdout. I've searched all around and I think I am close but something isn't right.

This is in Actionscript for an AIR app but that might not be significant. I am using VLC in "Remote Control" mode and am able to communicate with it through stdin to start and stop the stream. I am also getting data on stdout but it appears to be empty bytes.

I don't want to clog this question up with too much code so ask if you have any questions and I will fill in the details.

Skipping the Actionscript specific parts, these are the arguments I am sending to VLC – first to transcode to FLV:

processArgs = new Vector.<String>();
processArgs.push("-I rc");
processArgs.push("-vvv");
processArgs.push("--sout");
processArgs.push("#transcode{vcodec=FLV1,acodec=mp3}:standard{access=file,mux=ffmpeg{mux=flv}, dst=-}");

I have also tried variations on that:

processArgs.push("#transcode{vcodec=FLV1,vb=512,width=640,height=480,acodec=mp3,ab=128,samplerate=44100,channels=2}:gather:std{access=file,mux=flv,dst=-}");

And for .mp4:

processArgs.push("#transcode{vcodec=mp4v,acodec=mp4a}:std{access=file,mux=mp4,dst=-}"); 

After this set up I use the "add" rc command to add and then play a file.

process.standardInput.writeUTFBytes("add " + videoPath + " \n" );
process.standardInput.writeUTFBytes("play" + "\n" );

I can see data coming through and a snippet of the VLC debug info is below. It looks like I have things set up correctly but the data appears to be empty. Am I missing a step or parameter?


Partial VLC debug info for the mp4 pass:

[0000000105e02728] stream_out_transcode stream out debug: decoder aspect is 1.734417:1
[0000000105e02728] stream_out_transcode stream out debug: source pixel aspect is 0.975610:1
[0000000105e02728] stream_out_transcode stream out debug: scaled pixel aspect is 0.975610:1
[0000000105e02728] stream_out_transcode stream out debug: source 1280x720, destination 1280x720
[0000000105e02728] stream_out_transcode stream out debug: source fps 30/1, destination 30/1
[0000000105e02728] stream_out_transcode stream out: input interval 33333 (base 1)
[0000000105e02728] stream_out_transcode stream out: output interval 33333 (base 1)
[0000000105e02728] stream_out_transcode stream out debug: encoder aspect is 1280:738
[0000000105e02728] stream_out_transcode stream out debug: destination (after video filters) 1280x738
[00000001008408b8] core encoder debug: looking for encoder module matching "any": 19 candidates
[00000001008408b8] avcodec encoder debug: CPU flags: 0x0107d3db
[00000001008408b8] avcodec encoder debug: Time base for probing setted to 1/30
[00000001008408b8] avcodec encoder debug: Time base set to 1/30
[00000001008408b8] avcodec encoder debug: found encoder MPEG-4 Video
[00000001008408b8] core encoder debug: using encoder module "avcodec"
[0000000108600178] core mux debug: adding a new input
[0000000108600178] mux_mp4 mux debug: adding input

Aucun commentaire:

Enregistrer un commentaire