Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Can I create a virtual webcam and stream data to it ?

    1er octobre 2011, par Brad Bahls

    I am looking to stream a video from ffmpeg to OpenCV (a video manipulation library) and I am stumped. My idea is to create a virtual webcam device and then stream a video from ffmpeg to this device and the device will in turn stream like a regular webcam. My motivation is for OpenCV. OpenCV can read in a video stream from a webcam and go along its merry way.

    But is this possible? I know there is software to create a virtual webcam, but can it accept a video stream (like from ffmpeg) and can it stream this video like a normal webcam? (I am working in a cygwin environment , if that is important)

  • error is coming lib-faac-dev not found

    30 septembre 2011, par Rahul Mehta

    i installed faac from here http://sourceforge.net/projects/faac/files/faac-src/faac-1.28/faac-1.28.tar.gz/ and then m running this command which is giving me this error basicall i want to install ffmpeg with audio conversion for libmp3lame , means with audio conversion.

    sudo apt-get install build-essential subversion git-core checkinstall yasm texi2html libfaac-dev libjack-jackd2-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libsdl1.2-dev libtheora-dev libvorbis-dev libvpx-dev libx11-dev libxfixes-dev libxvidcore-dev zlib1g-dev
    
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package libfaac-dev
    

    following this article http://pasindudps.blogspot.com/2010/12/compiling-ffmpeg-in-ubuntu-1010.html

  • Why does ffmpeg never finish when converting a video from my web app ?

    30 septembre 2011, par Mike

    I am trying to convert a video when the user submits a form. It seems to convert ok but the file "is being used by another proccess" when I try to do anything with it. It looks like ffmpeg.exe never exits. My code is below is there anything I should be doing different to allow the process to release the file? If I run this manually it exits fine.

    internal class ConversionUtility : Utility
    {
        public void Convert(string videoFileName)
        {
            var video = new VideoFile(videoFileName);
    
            if (!video.infoGathered)
                GetVideoInfo(video);
    
            var Params = string.Format("-y -i \"{0}\" -coder ac -me_method full -me_range 16 -subq 5 -sc_threshold 40 -vcodec libx264 -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 -r 20 \"{1}\"", video.Path, Path.ChangeExtension(videoFileName,".mp4"));
            //var Params = string.Format("-y -i \"{0}\" -acodec libfaac -ar 44100 -ab 96k -coder ac -me_method full -me_range 16 -subq 5 -sc_threshold 40 -vcodec libx264 -s 1280x544 -b 1600k -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -i_qfactor 0.71 -keyint_min 25 -b_strategy 1 -g 250 -r 20 c:\\output3.mp4", video.Path, videoFileName);
            //var Params = String.Format(" {0} \"{1}\"",this.FFmpegLocation, video.Path);
    
            var threadStart = new ParameterizedThreadStart(del => RunProcess(Params));
            var thread = new Thread(threadStart);
            thread.Start();            
            //RunProcess(Params);
        }
    }
    
    internal class Utility
    {
        public string FFmpegLocation { get; set; }        
        private string WorkingPath { get { return Path.GetDirectoryName(FFmpegLocation); } }
    
        protected string RunProcess(string Parameters)
        {
            //create a process info
            var oInfo = new ProcessStartInfo(this.FFmpegLocation, Parameters)
            {
                UseShellExecute = false,
                CreateNoWindow = true,
                RedirectStandardOutput = true,
                RedirectStandardError = true
            };
    
            //Create the output and streamreader to get the output
            string output = null; StreamReader srOutput = null;
    
            //try the process
            try
            {
                //run the process
                Process proc = System.Diagnostics.Process.Start(oInfo);
    
                proc.WaitForExit();
                //if (!proc.WaitForExit(10000))
                //    proc.Kill();
    
    
                //get the output
                srOutput = proc.StandardError;
    
                //now put it in a string
                output = srOutput.ReadToEnd();
    
                proc.Close();
            }
            catch (Exception)
            {
                output = string.Empty;
            }
            finally
            {
                //now, if we succeded, close out the streamreader
                if (srOutput != null)
                {
                    srOutput.Close();
                    srOutput.Dispose();
                }
            }
            return output;
        }
    
  • Where is libavformat for FFMpeg located on Snow Leopard ?

    29 septembre 2011, par d.win

    Having an issue with getting a makefile to find the correct libraries and header files for a .c program I'm trying to compile. I'm trying to compile an open source segmenter for Apple's HTTP Live Streaming and it requires libavformat and other FFMpeg libraries to compile. I used Mac Ports to install FFMpeg and when I run "which ffmpeg" at command line, the directory it shows is opt/local/bin/ffmpeg, but after searching around, this doesn't seem to be the directory with the libraries.

    It seems that the libraries are located in opt/local/include because that is where I see the header files. Here is my makefile with the suspected directory:

    all: gcc -Wall -g live_segmenter.c -o live_segmenter -I/opt/local/include -I/opt/local/bin -I/opt/local/include/libavutil -L/opt/local/include/libavformat -libavformat -L/opt/local/include -libavcodec -L/opt/local/include -libavutil -L/opt/local/include -libavcore -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad -lpthread

    clean:
    rm -f live_segmenter
    

    And here is the output after trying to compile:

    gcc -Wall -g live_segmenter.c -o live_segmenter -I/opt/local/include -I/opt/local/bin - I/opt/local/include/libavutil -L/opt/local/include/libavformat -libavformat -L/opt/local/include -libavcodec -L/opt/local/include -libavutil -L/opt/local/include -libavcore -lbz2 -lm -lz -lfaac -lmp3lame -lx264 -lfaad -lpthread

    ld: library not found for -libavformat
    collect2: ld returned 1 exit status
    make: *** [all] Error 1
    

    I also tried running "ffmpeg -version" to see if ffmpeg was built correctly and it seems to be so I have run out of ideas on what to do. Any help or point in the right direction would be great. Thank you!

  • Upload audio file, convert bitrate, save to S3 | server side options ?

    29 septembre 2011, par Jonathan Coe

    Currently using PHP 5.3.x & Fedora

    Ok. I'll try to keep this simple. I'm working on a tool that allows the upload & storing of audio files on S3 for playback. Essentially, the user uploads a file (currently only allowing mp3 & m4a) to the server, and the file is then pushed to S3 for storage via the PHP SDK for amazon aws.

    The missing link is that I would like to perform a simple bitrate & format conversion of the file prior to uploading the file. (ensuring that all files are 160kbs and .mp3).

    I've looked into ffmpeg, although it seems that the PHP library only allows for reading bitrates and other meta, not for actual conversion.

    Does anyone have any thoughts on the best way to approach this? Would running a shell_exec() command that performs the conversion be sufficient to do this, or is there a more efficient/better way of doing this?

    Thanks in advance! Any help or advice is much appreciated.