Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • what is a good way to calculate frame rate using of a video ffmpeg ?

    20 septembre 2013, par user1914692

    I find three possible ways:

    (Option 1) inVStruct.inVideoStream->r_frame_rate

    [comment:] correct for some videos. Not always correct. it is libavformats guess, not exact. (see http://ffmpeg.org/pipermail/ffmpeg-devel/2005-May/003079.html )

    (Option 2) (double) inVStruct.inVideoStream->r_frame_rate.num / (double) inVStruct.inVideoStream->r_frame_rate.den

    [comment:] correct for some videos. Not always correct.

    (Option 3) (double) inVStruct.inCodecContext->time_base.den / (double) inVStruct.inCodecContext->time_base.num / inVStruct.inCodecContext->ticks_per_frame);

    [comment:] correct for some videos. Not always correct.

    Please recommend one for all video files.

  • How to write a ffmpeg command shell in C

    20 septembre 2013, par Gonzalo Solera

    it´s possible I´m asking a nonsense but I´m a bit noob... I´m trying to write native code in Android to change the resolution of a video using a FFmpeg. I compiled the library of FFmpeg and I added it to my project correctly after used the NDK. But now I want to execute this FFmpeg command shell:

    ffmpeg -i input.mp4 -s 480x320 output.mp4
    

    I need to execute it in a C file using the JNI but I don´t know how to call the equivalent methods of the command...

    I think I´m having a similar problem than here

    Thanks for help!!

  • Using Node.js module fluent-ffmpeg to convert video but my files end up corrupt

    19 septembre 2013, par El Guapo

    i am writing a node based media encoding tool and have found a few good node packages that will help me to do this, but the output files are either totally corrupt or it only encodes half the video.

    The main node package i am using is fluent-ffmpeg, and i am trying it with the following code:

    var ffmpeg = require('fluent-ffmpeg');
    
    var proc = new ffmpeg({ source: 'uploads/robocop-tlr1_h480p.mov', nolog: false})
      .withVideoCodec('libx264')
      .withVideoBitrate(800)
      .withAudioCodec('libvo_aacenc')
      .withAudioBitrate('128k')
      .withAudioChannels(2)
      .toFormat('mp4')
      .saveToFile('output/robocop.mp4',
        function(retcode, error){
            console.log('file has been converted succesfully');
    });
    

    There is not a problem with the source video as i encoded it just fine using FFmpeg normally with the following comand line string (i run it from a batch file):

    "c:\ffmpeg\bin\ffmpeg.exe" -i %1 -acodec libvo_aacenc -b:a 128k -ac 2 -vcodec libx264 -b:v 800k -f mp4 "../output/robocop2.mp4"
    

    Any ideas what i am doing wrong here?

  • _stricoll is unsolved while linking the libmingwex.a with vs2010

    19 septembre 2013, par damantou

    I am tending to build some app which staticly links the ffmpeg libs on windows 8. I have successfully build the static lib of ffmpeg in mingw/msys env on windows 8. Then I use cmake to generate the vs2010 project to start work with my app.

    While I am trying to build the first dead simple main program, I got quite some link errors.

    extern "C" {
    
    // to work around error:
    // 'UINT64_C': identifier not found
    #ifndef __STDC_CONSTANT_MACROS
    #define __STDC_CONSTANT_MACROS
    #endif
    
    
    #include avcodec.h>
    #include avformat.h>
    #include swscale.h>
    
    }
    
    
    int main(int argc, char *argv[])
    {
        av_register_all();
        return 0;
    }
    

    After struggling with a bunch of unresolved symbols, I come up with the following libraries to link with in order:

    c:/MinGW/mingw32/lib/libiconv.a
    libavcodec.a
    libavdevice.a
    libavfilter.a
    libavformat.a
    libavutil.a
    libswresample.a
    libswscale.a
    c:/MinGW/lib/gcc/mingw32/4.8.1/libgcc.a
    c:/MinGW/mingw32/lib/libws2_32.a
    c:/MinGW/mingw32/lib/libmingw32.a
    c:/MinGW/mingw32/lib/libmingwex.a
    

    Finally there is one unresolved symbol issue not able to fix:

    libmingwex.a(glob.o) : error LNK2019: unresolved external symbol 
                           _stricoll referenced in function _glob_match
    

    I tried to add some a fake function, but still not help :(

    int  __cdecl _stricoll(_In_z_  const char * _Str1, _In_z_  const char * _Str2)
    {
        return 0;
    };
    

    I googled it the whole morning, but nobody ever mentioned this problem. I guess there should be simple reason and solution for this, maybe because of my ignorance on simple knowledge.

  • Concat 2 H264 mov into mp4 using ffmpeg or other ?

    19 septembre 2013, par pixelwiz

    We recently bought a JVC GY-HM650U camcorder. One of the things it can do is record into a "web" format at the same time it records HD. However, the problem we've ran into is that it splits up the recording about every 30 minutes. I've contacted the manufacturer and they might fix the firmware in the future, but I need to do something about it now. So the camera produces an MOV file, but it's supposed to be a H.264 mp4 under the surface. I tried to follow the steps here: http://ffmpeg.org/trac/ffmpeg/wiki/How%20to%20concatenate%20%28join,%20merge%29%20media%20files but was not successful. I can either merge the two files into one mov, and if I try to play the MOV in JWPlayer for some reason I lose the audio. If I try to go into a .mp4 I get an error. I found some 3rd party software for joining video files without having to re-encode them if they are already encoded the same way, but none proved successful at producing a playable file with audio. Any suggestions?