Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • how to use guardianproject's android ffmpeg library ?

    21 octobre 2013, par Blaze Tama

    First, this is my first time "playing" with ffmpeg, so please bear with me.

    Generally, i dont understand ffmpeg even a little bit. So i did lot, lot of researches (and also trial & error) and i finally found this project and its library

    So i was successfully created the ffmpeg and sox binary file, and i put it in the raw folder at the library project (from the link i shared).

    Now, i want to use the library for my project, but i still cant do it. I tried to use some methods in the FfmpegController like combineAudioAndVideo and more but its not working (yet).

    I dont post the error here since i still do my trial&errors (and the error change regularly) but im getting tired now.

    EDIT

    This is what i did :

    private FfmpegController ffController;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            File file = new File(Uri.parse("android.resource://com.my.package/" + R.raw.test).getPath());
            try {
                ffController = new FfmpegController(this, file);
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
    
            MediaDesc desc = ffController.combineAudioAndVideo(R.raw.test, R.raw.musictest, "test.mp4", null);
        }
    

    The combineAudioAndVideo always error because wrong parameters. It needs MediaDesc but i dont know how to do it.

    I will be very happy if you can share your working code if you have done the ffmpeg processing with this library.

  • How to synchronize audio and video using ffmpeg libraries ?

    21 octobre 2013, par jsp99

    Stuck writing a very basic media player in C, using SDL and ffmpeg libraries. Initially, followed the theory in this page to get an idea about the entire program and the usage of libraries. After coding from scratch, thanks to that tutorial and many other resources, finally I made my code work, using the latest libraries of ffmpeg and SDL (2.0). But my code lacks a proper synchronization mechanism (actually it lacks a sync mechanism !).

    I still don't have a clear idea on how to synchronize the audio and video together as the theory provided in the link is only very partially correct (atleast when it comes to using the latest dev libraries).
    For example, a sentence in this page is as follows :

    However, ffmpeg reorders the packets so that the DTS of the packet being processed by avcodec_decode_video() will always be the same as the PTS of the frame it returns.

    I am using avcodec_decode_video2() and the DTS of the packet is definitely not the same as pts of the frame it decodes (in general).

    I read this very informative BBC report and it makes complete sense. I have a clear idea about PTS and DTS. But the PTS and DTS values that ffmpeg is using for packets and decoded frames is confusing. I wish there were some documentation on that aspect.

    Can someone explain the steps to synchronize audio and video ? I only need the steps. I am quite comfortable implementing them. Any help is greatly appreciated. Thanks !

    PS : Here's a screenshot of what I am talking about :

    enter image description here

    The huge negative value is, I assume AV_NOPTS_VALUE.

  • FFMpeg creates MP4 which no browser can decode, but it can be played in VLC

    21 octobre 2013, par wvxvw

    How can I debug what happened? I've tried this with variations to generate a short video from a single image:

    ffmpeg -loop 1 -i black.png -vcodec libx264 -b 1500k -s 640x360 -t 1 out.mp4
    

    tried:

    1. Changing aspect ration (or omitting it).
    2. using -image2 instead of -loop.
    3. omitting bitrate.
    4. creating longer videos.
    5. also tried different syntax for specifying video codec: -v:c libx264.
    6. tried mpeg instead of libx264.

    In every case the effect is the same. The video plays in VLC, but not in the browser.

  • Cancel ffmpeg from javascript frontend

    21 octobre 2013, par user2628572

    I'm using ffmpeg with php to convert video uploaded by the user, the frontend written in javascript/html sends the file to a php script in the backend that does the conversion with exec.

    How can I cancel the conversion when the user click cancel from the frontend? please note that the file is uploaded and the conversion is started already.

  • Is final muxed filesize of two input streams to ffmpeg always equal to = stream1size + stream2size ?

    20 octobre 2013, par Stacked

    When using this command $cmd = "ffmpeg -i " . $inputaudioURL . " -i " . $inputvideoURL . " -acodec copy -vcodec copy muxed.mp4"; will the final filesize (for use in Content-length header) always equal to file-size of $inputaudioURL + $inputvideoURL ?