将VLC流保存到mp4配置

时间:2013-12-12 14:15:40

标签: c# video mp4 vlc libvlc

我在使用C#的WPF应用程序中使用VLC组件,并将此选项添加到VLC:

 Options = @":sout=#duplicate{dst=display,dst=std{access=file,mux=ts,dst=" + outputFileName + "}}";

使用此选项,我可以将流保存到mpg。

我想将流保存到mp4并尝试:

Options = @":sout=#duplicate{dst=display,dst=std{access=file,mux=mp4,dst=" + outputFileName + "}}";

Options = @":sout=#transcode{vcodec=theo,vb=800, scale=1,acodec=flac,ab=128,channels=2,samplerate=44100}:std{access=file,mux=ogg,dst=" + outputFileName + "}}";

但这两个选项VLC根本不起作用。

如果我想保存到mp4

,我应该使用什么选项进行sout

提前谢谢

1 个答案:

答案 0 :(得分:0)

my case:

string s = "rtsp://address:554/stream";
VlcControl vlcControl = null;
Thread thread = new Thread(() => { vlcControl = new VlcControl(); });
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
vlcControl.MediaPlayer.VlcLibDirectoryNeeded += OnVlcControlNeedsLibDirectory;
vlcControl.MediaPlayer.EndInit(); //Important
prms = prms.Concat(new String[] { ":sout=#transcode{vcodec=mp4v,acodec=none,vb=128,deinterlace}:std{access=file,mux=mp4,dst=" + pathNameFile + "_" + i++ + ".mp4}"}).ToArray();
vlcControl.MediaPlayer.Play(new Uri(s), prms);