Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • playing ffmpeg in android

    8 janvier 2012, par John

    I am developing an android project in which i need to play ffmpeg format videos.I think android doesn't support ffmpeg formats.

    I have downloaded ffmpeg codec and loaded the library "libffmpeg.so" in my project using android ndk and JNI.

    Now,how can i use this "libffmpeg.so" to play those video formats.
    

    My project directory structure is like this.

    enter image description here

    Any one please help.

  • Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

    7 janvier 2012, par Rocky Singh

    I am trying to convert an avi video file to flv format via FFMPEG with the following command:

    -i C:\files\input\test.avi -y -ab 448k -ar 48000 -vcodec mpeg4 -s 640x480 -f flv C:\files\output\test.flv
    

    Here is the response I am getting from ffmpeg:

    Input:

    Input #0, avi, from 'C:\files\input\test.avi':
      Metadata:
        encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
      Duration: 00:01:00.00, start: 0.000000, bitrate: 1813 kb/s
        Stream #0:0: Video: mpeg4 (Advanced Simple Profile) (XVID / 0x44495658), yuv420p, 640x272 [SAR 1:1 DAR 40:17], 25 tbr, 25 tbn, 25 tbc
        Stream #0:1: Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, 5.1(side), s16, 448 kb/s
    

    Output:

    Output #0, flv, to 'C:\files\output\test.flv':
      Metadata:
        encoder         : VirtualDubMod 1.5.10.2 (build 2540/release)
        Stream #0:0: Video: mpeg4, yuv420p, 640x480 [SAR 30:17 DAR 40:17], q=2-31, 200 kb/s, 90k tbn, 25 tbc
        Stream #0:1: Audio: mp3, 48000 Hz, 5.1(side), s16, 448 kb/s
    Stream mapping:
      Stream #0:0 -> #0:0 (mpeg4 -> mpeg4)
      Stream #0:1 -> #0:1 (ac3 -> libmp3lame)
    Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
    

    Can you tell me what is MAY BE here? and what is wrong above?

  • Converting videos to flv using ffmpeg

    6 janvier 2012, par user703526

    In my c# application, i am writing code for converting any video format to flv format. For this FFMPEG is used.

    Some times an exceptions is occuring like:

    Attempted to read or write protected memory. This is often an indication that other memory is corrupt

    Below is my code from where the exception throwing,

        IntPtr pFormatContext;
        FFmpeg.av_register_all();
    
        int ret;
        ret = FFmpeg.av_open_input_file(out pFormatContext, this.Filename, IntPtr.Zero, 0, IntPtr.Zero);
    
        if (ret < 0)
        {
            Trace.WriteLine("couldn't open input file");
    
            FFmpeg.av_free_static();
            return;
        }
    
    
        try
        {
            ret = FFmpeg.av_find_stream_info(pFormatContext);
    
            if (ret < 0)
            {
                Trace.WriteLine("couldnt find stream informaion");
                FFmpeg.av_close_input_file(pFormatContext);
                FFmpeg.av_free_static();
                return;
            }
    
    
            FFmpeg.AVFormatContext formatContext = (FFmpeg.AVFormatContext)Marshal.PtrToStructure(pFormatContext, typeof(FFmpeg.AVFormatContext));
    
            Duration = formatContext.duration / FFmpeg.AV_TIME_BASE;
    
            for (int i = 0; i < formatContext.nb_streams; ++i)
            {
                FFmpeg.AVStream stream = (FFmpeg.AVStream)Marshal.PtrToStructure(formatContext.streams[i], typeof(FFmpeg.AVStream));
                FFmpeg.AVCodecContext codec = (FFmpeg.AVCodecContext)Marshal.PtrToStructure(stream.codec, typeof(FFmpeg.AVCodecContext));
    
                if (codec.codec_type == FFmpeg.CodecType.CODEC_TYPE_VIDEO)
                {
                    Height = codec.height;
                    Width = codec.width;
    
                            Type = FileType.flv;
                            MimeType = "video/x-flv";
    
                }
    
            }
        }
        catch (Exception ex)
        {
            Trace.WriteLine("FFMpeg failed to understand the file");
        }
    
        FFmpeg.av_close_input_file(pFormatContext);
        FFmpeg.av_free_static();
    }
    

    And from the above code this ret = FFmpeg.av_find_stream_info(pFormatContext); line throws memory corrupt exception. Please help me to solve this issue.

  • FFmpeg vs Libav ?

    6 janvier 2012, par Shimmy

    I just realized that Libav is a fork of FFmpeg.

    I'm now about to develop a media program that will have to involve the use of such a tool. Should I stick to FFmpeg? Are there any significant features in Libav downbeating FFmpeg?

    What considerations do you recommend?

  • FFMPEG - Correct command line parameters to create a H.264 Streaming MP4 from a set of images

    5 janvier 2012, par Adam

    I have no problems viewing a video created by my current parameters in a HTML5 browser, Flash player, Windows Phone 7, Android Phone, etc. However, they won't display on iPhone or iPad. If I modify the video using Super and select "Enable Streaming" checkbox they work on iPhone and iPad suddenly. We are suspecting that my command line parameters are incorrect for enabling h.264 streaming and are instead generating a "progressive download" video.

    I'm pretty new to FFMPEG and don't understand a lot of the parameters. Can anyone help correct my existing parameters, or maybe provide the missing parameters, etc?

    Thanks in advance.

    My current FFMPEG command line paramters are:

    ffmpeg.exe 
     -r 30 
     -threads 4 
     -f image2 
     -i .\frame%05d.jpg 
     -i audioFile  
     -acodec aac 
     -ab 128k 
     -ar 44100
     -vcodec h264 
     -crf 27 
     -coder 1 
     -flags +loop 
     -cmp +chroma 
     -partitions +parti4x4+partp8x8+partb8x8 
     -me hex 
     -subq 5 
     -me_range 16 
     -g 60 
     -keyint_min 25 
     -sc_threshold 40 
     -i_qfactor 0.71 
     -b_strategy 1 
     out.mp4