4

我有这个代码:

public void Start(string FileName, Bitmap Sample_Bitmap, int BitmapRate )
        {
            p = new NamedPipeServerStream(pipename, PipeDirection.Out, 1, PipeTransmissionMode.Byte);
            byte[] b = new byte[1280 * 720 * 3]; // some buffer for the r g and b of pixels of an image of size 720p 
            System.Diagnostics.Process process = new System.Diagnostics.Process();
            process.StartInfo.FileName = @"D:\pipetest\pipetest\ffmpegx86\ffmpeg.exe";
            process.EnableRaisingEvents = false;
            process.StartInfo.WorkingDirectory = @"D:\pipetest\pipetest\ffmpegx86";
            process.StartInfo.Arguments = @"-f rawvideo -pix_fmt rgb24 -video_size 1280x720 -i
                                          \\.\pipe\mytestpipe -map 0 -c:v libx264 -r " + BitmapRate + " " + FileName;
            process.Start();

            process.StartInfo.UseShellExecute = false;
            process.StartInfo.CreateNoWindow = false;
            p.WaitForConnection();
        }

所以我知道 BitmapRate 做什么和 FileName 但其余的参数。

这意味着什么,-f ?而原始视频是来自解码器或编码器? -i ? -c:v ? libx264的编解码器,我猜是-r ?

试图用谷歌搜索这种参数格式,但没有找到。

我有 4 个文本文件列表:

encoders.txt decoders.txt在这两个文件中我也有 rawvideo。我有pixfmts.txt and fileformats.txt文件。

我想从变量构建参数字符串。

因此,例如 BitmapRate 是 int 而 FileName 是 string。其余的论点我应该在函数中放入什么类型的变量?

例如

rgb24是什么类型的?1280x720 应该是什么类型的变量?

4

1 回答 1

2

你看过这个链接吗?

http://linux.die.net/man/1/ffmpeg

它可能会回答您关于 1280x720 等参数的一些问题。通过这个,希望您可以映射到您的要求(使用 ffmpeg.exe !)并验证!

于 2013-05-24T07:51:11.453 回答