I am currently developing a site that converts videos to a streaming format and plays these streaming videos. I am using ffmpeg as my conversion engine, and am encountering a couple issues.

1) I dont seem to be able to make the videos convert to .flv files. I have tried a large number of arguments, including...

string outputSWF = Page.MapPath(folder + videoName + ".swf");

                    Process convert = new Process();

//These are the 3 arguments that I have tried.  Two do nothing, ie create my output file as size 0kb.  The other creates it as an appropriate, but wont play the file.

                    convert.StartInfo.Arguments = " -i \"" + videoRaw + "\" -f flv \"" + outputSWF + "\"";
                    convert.StartInfo.Arguments = " -i \"" + videoRaw + "\" -f flv -s 320×240 \"" + outputSWF + "\"";
                    convert.StartInfo.Arguments = " -i \"" + videoRaw + "\" -ar 22050 -ab 32 -f flv -s 320×240 \"" + outputSWF + "\"";


                    convert.StartInfo.FileName = Page.MapPath("ffmpeg/ffmpeg.exe");
                    convert.StartInfo.RedirectStandardOutput = false;
                    convert.Start();
                    convert.WaitForExit();

To play these I am using JW Player, which I have been able to make work with .swf's for the most part.

2) With that said, I have no trouble converting to .swf and playing these. So after struggling for hours to unsuccessfully convert to .flv, I thought i would simply use the .swf, but if this is the case I need to learn how to add playback controls to them.

I am using this to successfully convert to .swf...

string outputSWF = Page.MapPath(folder + videoName + ".swf");

                    Process convert = new Process();

//Here's my good argument

                    convert.StartInfo.Arguments = " -i \"" + videoRaw + "\" -s 480*360 -deinterlace -ab 32 -r 15 -ar 22050 -ac 1 \"" + outputSWF + "\"";

                    convert.StartInfo.FileName = Page.MapPath("ffmpeg/ffmpeg.exe");
                    convert.StartInfo.RedirectStandardOutput = false;
                    convert.Start();
                    convert.WaitForExit();

Help with either of these issues would be greatly appreciated. Thank you

After more searching, I believe I understand what my problem is. I am not inserting the meta data into the .flv. With that known, I'm not sure how to complete that part of the task. I have flvtool2.exe in the same folder as ffmpeg.exe, but am not sure how to complete the task.

I think this post on codeproject addresses my issue but it's written in vb.net which I am a novice in.

http://www.codeproject.com/KB/aspnet/Any_Video_to_FLV.aspx

If anyone could explain what I need to be doing with this line...

Dim filebuffer As String = "-U """ & outputPath & "\" & out & """"

I get that I'm creating another argument string, but its never addressed later in the code. And he never directly accesses flvtool2, so I'm confused.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.