VLC语法转码和流到stdout? [英] VLC syntax to transcode and stream to stdout?
问题描述
目标:我正在尝试使用
更新2:所以在我的 AIR
应用程序我能够粗略地解析来自
VLC
的传入的 stdout
流。我想看看是否正在发送FLV标题数据 - 似乎是这样。我不知道它是否是正确的格式等,但正如我上面提到的,如果我写一个.flv文件,而不是 stdout
,一个有效的.flv文件被创建。
完全失去了 - 已经尝试了所有可以想到的内容,并跟踪了所有涉及到的问题的网页链接。唉 - 如此接近,从 AIR
内的 VLC
可以很酷。
Goal: I am trying to use VLC as a local server to expand the video capabilities of an app created with Adobe AIR
, Flex
and Actionscript
. I am using VLC
to stream to stdout
and reading that output from within my app.
VLC Streaming capabilities
VLC Flash Video
Stream VLC to Website with asf and Flash
Status: I am able to launch VLC
as a background process and control it through its remote control interface (more detail). I can load, transcode and stream a local video file. The example app below is a barebones testbed demonstrating this.
Issue: I am getting data in to my app but it is not rendering as video. I don't know if it is a problem with my VLC commands or with writing to/reading from stdout
. This technique of reading from stdout
in AIR works (with ffmpeg
for example).
One of the various transcoding commands I have tried:
-I rc // remote control interface
-vvv // verbose debuging
--sout // transcode, stream to stdout
"#transcode{vcodec=FLV1}:std{access=file,mux=ffmpeg{mux=flv},dst=-}"
This results in data coming into to my app but for some reason it is not rendering as video when using appendBytes
with the NetStream
instance.
If instead I write the data to an .flv file, a valid file is created – so the broken part seems to be writing it to stdout
. One thing I have noticed: I am not getting metadata through the stdout`method. If I play the file created with the command below, I do see metadata.
// writing to a file
var output:File = File.desktopDirectory.resolvePath("stream.flv");
var outputPath:String = output.nativePath;
"#transcode{vcodec=FLV1}:std{access=file,mux=ffmpeg{mux=flv},dst=" + outputPath + "}");
Hoping someone sees where I am going wrong here.
Update 1: Just to add some more detail (!) – I took a look at the .flv file that is generated to examine the metadata. It appears at the head of the file as shown below. I have the correct onMetaData
handler set up and see a trace of this data if I play the file from disk. I do not see this trace when reading from stdout
and NetStream
is in Data Generation
mode. Is it possible that it isn't getting sent to stdout
for some reason? I've tried generating my own header and appending that before the stream starts – I may not have the header format correct.
Update 2: So in my AIR
app I was able to crudely parse the incoming stdout
stream coming from VLC
. I wanted to see if the FLV header data was being sent – and it appears that it is. I don't know if it is in the correct format, etc. but as I mention above, if I write to an .flv file instead of stdout
, a valid .flv file is created.
Completely at a loss now – have tried everything I could think of and followed up every web link I could find on the issues involved. Alas – so close and it would have been so cool to leverage VLC
from within AIR
.
这篇关于VLC语法转码和流到stdout?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!