none
Please HELP me! I need a flv converter!! RRS feed

  • Question

  • Please! I do not know which category to pick, I just need a FLV Converter! One I can trust for Windows 7.
    • Moved by Stanly Fan Tuesday, May 30, 2017 8:14 AM
    Sunday, May 28, 2017 12:17 AM

All replies

  • U need the thought or code or just a program?
    Sunday, May 28, 2017 1:04 AM
  • u can try "format factory"
    Monday, May 29, 2017 1:16 AM
  • Hi Miso,

    Could you please provide which technology do you use, is it Winform? WPF? of another. And which language? C# or VB or etc.

    And I suggest you can provide more details about your question, do you want to convert another type to FLV or convert FLV to another type, and what is FLV, I guess it is a video format, if so, please refer to the following code(convert mpeg or avi to flv):

    string tools = @"F:/Temp/FLVConventDemo/Tools/ffmpeg.exe";
    string source = @"F:/Temp/FLVConventDemo/UpFile/avi001.avi";
    string file = @"F:/Temp/FLVConventDemo/UpFile/flv001.flv";
    string args = " -i " + source + " -ab 64 -ar 22050 -b 500 -r 15 -s 800x600 " + file;
    ProcessStartInfo startInfo = new ProcessStartInfo(tools);
    
    startInfo.WindowStyle = ProcessWindowStyle.Hidden;
    startInfo.Arguments = args;
    
    Process.Start(startInfo);

    Parameter description:

    -i : input file name

    -ab 64: Audio data traffic

    -ar 22050: Sound sampling frequency

    -b 500: Video traffic data

    -r 15: set frame rate

    -s: set frame size

    And if you use the Windows Form, then please refer to the following complete project(convert mpeg to flv):

    Interface:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    namespace ffmpeg_FLV
    {
        interface IConvert
        {
            // target file
            bool Convert(string sourceFile);
    
            //Get thumbnails
            bool GetSmallImage(string sourceFile);
        }
    }

    Implement the interface:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Configuration;
    
    namespace ffmpeg_FLV
    {
       public  class FfmpegConvert : IConvert
        {
            //mpeg file path
            private string ConvertTool = ConfigurationManager.AppSettings["FfmpegPath"] + "ffmpeg.exe";
    
            public FfmpegConvert()
            {
    
            }
    
            //convert to flv
            //target file
            public bool Convert(string sourceFile)
            {
                try
                {
                    //Whether the file name is empty
                    if (string.IsNullOrEmpty(sourceFile)) return false;
                    //Check if the file exists
    
                    string TargetFile = sourceFile.Substring(0, sourceFile.Length - 4) + ".flv";
                    string Argu = @"-i " + sourceFile + " -ab 56 -ar 22050 -b 500 -r 15 -s 480x360 " + TargetFile;
    
                    System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(ConvertTool, Argu);
                    System.Diagnostics.Process.Start(startInfo);
                    System.Threading.Thread.Sleep(6000);
                    return true;
    
                }
                catch (Exception exp)
                {
                    throw exp;
                }
    
            }
    
            //Get thumbnails
            public bool GetSmallImage(string sourceFile)
            {
    
                //Whether the file name is empty
                if (string.IsNullOrEmpty(sourceFile)) return false;
                //Check if the file exists
    
                try
                {
                    string TargetFile = sourceFile.Substring(0, sourceFile.Length - 4) + ".jpg";
                    string Argu = @"-i " + sourceFile + " -y -f image2 -ss 08.010 -t 0.001 -s 352x240 " + TargetFile;
                    System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(ConvertTool, Argu);
                    System.Diagnostics.Process.Start(startInfo);
                    System.Threading.Thread.Sleep(6000);
    
    
                    return true;
    
                }
                catch (Exception exp)
                {
                    throw exp;
                }
    
            }
        }
    }

    Main form:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Configuration;
    using System.Threading;
    
    namespace ffmpeg_FLV
    {
        public partial class Form1 : Form
        {
            private static int threadCount = int.Parse(ConfigurationManager.AppSettings["ThreadCount"]);
            private static IConvert tool = new FfmpegConvert();
            private static int completeCount = 0;
            public Form1()
            {
                InitializeComponent();
            }
    
            // Convert 
            private static void ProcessVideo()
            {
                string waitConvertFile = @" F:\ChormeDownLoad\1\vmd.mpg";
                while (true)
                {
                    if (!string.IsNullOrEmpty(waitConvertFile))
                    {
                        //Convert
                        Console.WriteLine("start to convert file:" + waitConvertFile + "");
                        try
                        {
                            if (tool.Convert(waitConvertFile) && tool.GetSmallImage(waitConvertFile))
                            {
                                completeCount++;
    
                                //Change waitConvertFile status if need
    
                            }
                        }
                        catch (Exception exp)
                        {
                            //setting Convert failure
                            Console.WriteLine("file" + waitConvertFile + "Convert failure");
                        }
                        Console.WriteLine("file" + waitConvertFile + "Convert ending");
                        Thread.Sleep(1000);
                    }
                    Thread.Sleep(1000 * 60);
    
                }
    
            }
    
            private void Form1_Load(object sender, EventArgs e)
            {
                ProcessVideo();
            }
    
        }
    }

    App.config:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <appSettings>
        <!--convert tools path-->
        <add key="FfmpegPath" value="D:\tools\"/>
        <!-- setting -->
        <add key="ThreadCount" value="1" />
        <add key="BatchSize" value="10" />
        <add key="QueueTimeout" value="20" />
        <add key="TransactionTimeout" value="30" />
      </appSettings>
    </configuration>

    Hope this helps!

    Best Regards,

    Stanly


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Edited by Stanly Fan Monday, May 29, 2017 2:17 AM
    • Proposed as answer by Stanly Fan Tuesday, May 30, 2017 7:42 AM
    Monday, May 29, 2017 2:16 AM