Newest 'ffmpeg' Questions - Stack Overflow

http://stackoverflow.com/questions/tagged/ffmpeg

Les articles publiés sur le site

  • How to do make a loading screen for ffmpeg using c# asp.net

    1er septembre 2011, par anthonypliu

    I have this function and where the Debug.WriteLine commands are is where I output the values. How would I get this data to print into a webpage so I can mimic a loading screen? I am calling this function externally through a *.ashx web service file.

    private string ConvertToFLV(string phyicalFilePath)
            {
                if (Path.GetExtension(phyicalFilePath).Equals(".flv")) return phyicalFilePath;
    
                var argument = string.Format(@"-i ""{0}"" -vcodec flv -f flv -r 29.97 -s 320x240 -aspect 4:3 -b 300k -g 160 -cmp dct  -subcmp dct  -mbd 2 -flags +aic+cbp+mv0+mv4 -trellis 1 -ac 1 -ar 22050 -ab 56k ""{1}""", phyicalFilePath, Path.ChangeExtension(phyicalFilePath, "flv"));
                libfaac -ar 48000 -ab 128k -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -me_method hex -subq 6 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -b_strategy 1 -threads 0 {1}", phyicalFilePath, Path.ChangeExtension(phyicalFilePath, "mp4"));
                File.Delete(Path.ChangeExtension(phyicalFilePath, "flv"));
    
                ProcessStartInfo process = new ProcessStartInfo(ffmpegPhysicalPath, argument);
                Process proc = new Process();
                float duration = 0.00F, current = 0.00F;
                proc.StartInfo = process;
                proc.EnableRaisingEvents = false;
                proc.StartInfo.UseShellExecute = false;
                proc.StartInfo.CreateNoWindow = true;
                proc.StartInfo.RedirectStandardOutput = true;
                proc.StartInfo.RedirectStandardError = true;
    
                proc.Start();
    
                StreamReader d = proc.StandardError;
    
                do
                {
                    string s = d.ReadLine();
                    if (s.Contains("Duration: "))
                    {
                        Debug.WriteLine("DURATION: " + s);
    
                    }
                    else
                    {
                        if (s.Contains("frame="))
                        {
                            Debug.WriteLine("FRAME: " + s);
    
                        }
                    }
                } while (!d.EndOfStream);
    
    
                proc.WaitForExit();
    
                return Path.ChangeExtension(phyicalFilePath, "flv");
    
  • how can I play ffmpeg codecs not supported by MedicaPlayer ? [closed]

    1er septembre 2011, par Jun

    Currently, I'm using MediaPlayer to play mp4, 3gp videos and it works as it should do but now I need to play ffmpeg codecs too.

    In this case, do I have to develop my video player or is there any players from 3rd parties?

    Thanks in advance.

  • Convert RTP/UDP Stream to HTTP with ffmpeg

    31 août 2011, par inversus

    As you may know, Android uses a strange implementation of RTP - It can only play low bitrate RTP streams. On the other hand, it can play Full HD HTTP stream flawlessly.

    I'm trying a workaround for this problem: As stated in the title, using ffmpeg to convert the RTP/UDP stream to HTTP.

    I've already compile ffmpeg for android, but I'm having difficulties configuring the ffserver.conf.

    1. Is it possible to achieve what I want with ffmpeg?
    2. I dont need any transcoding, will it use lots of the processor/memory?
    3. Can you help me with these configurations?

    I receive a udp/rtp multicast stream:

    • udp://@239.192.1.31:1234 or rtp://@239.192.1.31:1234 - TV channels

    I want to output to HTTP:

    Thank you in advance
    inversus

  • A .NET P/Invoke to convert with ffmpeg ?

    31 août 2011, par Shimmy

    I need to create a program that should convert audio and video files to supported types.

    I've found ffmpeg to be a great tool. However I donno C (which ffmpeg was written with), and I was wondering if there is a way (besides command-line which I donnu if I would use since I'm not sure if you can control the conversion process and get info about its percentage) that I can interact with ffmpeg and build a conversion program on it's API.

    Basically I'm looking for a single .NET-compatible method:

    void Convert(sourceFile, targetFile, string targetExtension);
    

    It shouldn't ask for bitrate etc., but only should it try to make a 1 to 1 conversion.

    I don't know how to write the underlying P/Invoke, and since I donno ffmpeg from inside, I can't tell what dll it uses, so even I'd want to write the PI myself, I don't know what among the zillion functions of the ffmpeg libraries the conversion functions are.

    So any guidance or approach will be really appreciated.

  • Trouble with the ffmpeg -ss flag when capturing one frame from a Macbook iSight webcam

    31 août 2011, par Andy

    For about five years I've used ffmpeg in a shell script to grab one frame from my linux'd-up Macbook's iSight:

    ffmpeg -f video4linux2 -s 640x480 -r 15 -i /dev/video0 -an -vframes 1 -vcodec mjpeg -y -sameq -ss 1.5 snapshot.jpg
    

    I just upgraded my Ubuntu distro from Lucid to Natty (ffmpeg ver. 0.6.2-4:0.6.2-1ubuntu1). Now that syntax turns the iSight on but hangs indefinitely.

    [output snipped, ending with:]
    frame=    0 fps=  0 q=0.0 Lsize=      -0kB time=10000000000.00 bitrate=  -0.0kbits/s    
    video:0kB audio:0kB global headers:0kB muxing overhead -inf%
    

    Without the '-ss' flag it seems to successfully grab the first frame and exit immediately - the only difference in output being:

    frame=    1 fps=  0 q=0.0 Lsize=      -0kB time=0.07 bitrate=  -2.6kbits/s    
    video:16kB audio:0kB global headers:0kB muxing overhead -100.132730%
    

    However, the '-ss 1.5' was necessary to delay the frame capture by 1.5 seconds to allow the cam sufficient time to adjust the exposure.

    The -itsoffset flag seemed promising, but doesn't seem to change ffmpeg's behavior (ie doesn't hang, but no delay).

    Any ideas?