Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg file size inconsistent

    27 juillet 2015, par Michael Clayton

    Using ffmpeg to create previews for videos, 120 seconds. I notice the resulting file is different in size depending on if I work with the input file locally or remotely using an URL.

    the resulting file is smaller when I use a URL.

    I guess I am losing data?

  • Android FFMPEG library crashes on Lollipop

    27 juillet 2015, par Laurent Gorse

    I'm using this open-source library to encode RTMP streams for my live streaming app:

    https://github.com/cine-io/cineio-broadcast-android

    The library is based on FFMPEG with libRTMP, and is open-source. It build the following native shared library: https://github.com/cine-io/ffmpegbridge

    Which relies on this: https://github.com/cine-io/android-ffmpeg-with-rtmp

    The issue is Lollipop compatibility. There's a notorious issue where libraries need to be recompiled with PIE, but usually the thrown error is specific and states that "all binaries must be compiled with PIE".

    However, as soon as I start streaming on Android 5.+, this is the error I get from the backtrace:

    D/CrashAnrDetector(  903): Build: samsung/klteuc/klteatt:5.0/LRX21T/G900AUCU4BOF2:user/release-keys
    D/CrashAnrDetector(  903): Hardware: MSM8974
    D/CrashAnrDetector(  903): Revision: 14
    D/CrashAnrDetector(  903): Bootloader: G900AUCU4BOF2
    D/CrashAnrDetector(  903): Radio: unknown
    D/CrashAnrDetector(  903): Kernel: Linux version 3.4.0-4432708 (dpi@SWDD6014) (gcc version 4.8 (GCC) ) #1 SMP PREEMPT Thu Jun 18 17:58:46 KST 2015
    D/CrashAnrDetector(  903): 
    D/CrashAnrDetector(  903): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    D/CrashAnrDetector(  903): Build fingerprint: 'samsung/klteuc/klteatt:5.0/LRX21T/G900AUCU4BOF2:user/release-keys'
    D/CrashAnrDetector(  903): Revision: '14'
    D/CrashAnrDetector(  903): ABI: 'arm'
    D/CrashAnrDetector(  903): pid: 18365, tid: 18877, name: FFmpeg  >>> com.streem.mobile.android <<<
    D/CrashAnrDetector(  903): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x68
    D/CrashAnrDetector(  903):     r0 00000000  r1 9c9c1038  r2 00000003  r3 80000000
    D/CrashAnrDetector(  903):     r4 00017002  r5 9c9e2a64  r6 a0c46400  r7 afb6d400
    D/CrashAnrDetector(  903):     r8 00000002  r9 00000002  sl b3b6a680  fp 00000000
    D/CrashAnrDetector(  903):     ip b3b70100  sp 9f88f838  lr 9c8bafa8  pc 9c898438  cpsr 600f0010
    D/CrashAnrDetector(  903):     d0  0000000000000000  d1  0000000000000000
    D/CrashAnrDetector(  903):     d2  6572745356412074  d3  5f656d69742e6d61
    D/CrashAnrDetector(  903):     d4  0000000000000000  d5  0000000300000004
    D/CrashAnrDetector(  903):     d6  0000000000000000  d7  ffff000000000000
    D/CrashAnrDetector(  903):     d8  c3d80000c4ca8000  d9  3f8000003f800000
    D/CrashAnrDetector(  903):     d10 0000000000000000  d11 0000000000000000
    D/CrashAnrDetector(  903):     d12 0000000000000000  d13 0000000000000000
    D/CrashAnrDetector(  903):     d14 0000000000000000  d15 0000000000000000
    D/CrashAnrDetector(  903):     d16 564120676e697355  d17 632e6d6165727453
    D/CrashAnrDetector(  903):     d18 6d69742e6365646f  d19 6120657361625f65
    D/CrashAnrDetector(  903):     d20 656d697420612073  d21 6e69682065736162
    D/CrashAnrDetector(  903):     d22 656874206f742074  d23 6920726578756d20
    D/CrashAnrDetector(  903):     d24 0000000000000000  d25 0000000000000000
    D/CrashAnrDetector(  903):     d26 0001000100010001  d27 0002000100010001
    D/CrashAnrDetector(  903):     d28 0080008000800080  d29 0080008000800080
    D/CrashAnrDetector(  903):     d30 0800080008000800  d31 0800080008000800
    D/CrashAnrDetector(  903):     scr 20000011
    D/CrashAnrDetector(  903): 
    D/CrashAnrDetector(  903): backtrace:
    D/CrashAnrDetector(  903):     #00 pc 00038438  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so (avio_write)
    D/CrashAnrDetector(  903):     #01 pc 0005afa4  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so
    D/CrashAnrDetector(  903): 
    D/CrashAnrDetector(  903): stack:
    D/CrashAnrDetector(  903):          9f88f7f8  afb6d400  
    D/CrashAnrDetector(  903):          9f88f7fc  00000004  
    D/CrashAnrDetector(  903):          9f88f800  00000001  
    D/CrashAnrDetector(  903):          9f88f804  b3b6a680  
    D/CrashAnrDetector(  903):          9f88f808  00000000  
    D/CrashAnrDetector(  903):          9f88f80c  b6f34a9d  /system/lib/libc.so (posix_memalign+12)
    D/CrashAnrDetector(  903):          9f88f810  7fffffdf  /dev/ashmem/dalvik-alloc-space-gap (deleted)
    D/CrashAnrDetector(  903):          9f88f814  9ee5393c  /data/app/com.streem.mobile.android-2/lib/arm/libavutil-54.so (av_malloc+80)
    D/CrashAnrDetector(  903):          9f88f818  9c9e2a64  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so
    D/CrashAnrDetector(  903):          9f88f81c  b3bf1cd0  
    D/CrashAnrDetector(  903):          9f88f820  00017002  
    D/CrashAnrDetector(  903):          9f88f824  b3bf1cd0  
    D/CrashAnrDetector(  903):          9f88f828  b3b70128  
    D/CrashAnrDetector(  903):          9f88f82c  00017002  
    D/CrashAnrDetector(  903):          9f88f830  9c9e2a64  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so
    D/CrashAnrDetector(  903):          9f88f834  9c8baf54  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so
    D/CrashAnrDetector(  903):     #00  9f88f838  00000000  
    D/CrashAnrDetector(  903):          ........  ........
    D/CrashAnrDetector(  903):     #01  9f88f838  00000000  
    D/CrashAnrDetector(  903):          9f88f83c  00000019  
    D/CrashAnrDetector(  903):          9f88f840  afb6d400  
    D/CrashAnrDetector(  903):          9f88f844  9c9c11f0  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so
    D/CrashAnrDetector(  903):          9f88f848  9c9c1110  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so
    D/CrashAnrDetector(  903):          9f88f84c  9c9c109c  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so
    D/CrashAnrDetector(  903):          9f88f850  7fffffff  /dev/ashmem/dalvik-alloc-space-gap (deleted)
    D/CrashAnrDetector(  903):          9f88f854  00000000  
    D/CrashAnrDetector(  903):          9f88f858  b3bbcba8  
    D/CrashAnrDetector(  903):          9f88f85c  00000000  
    D/CrashAnrDetector(  903):          9f88f860  a0c46874  
    D/CrashAnrDetector(  903):          9f88f864  9c9cf9d4  /data/app/com.streem.mobile.android-2/lib/arm/libavformat-56.so
    D/CrashAnrDetector(  903):          9f88f868  a0c46400  
    D/CrashAnrDetector(  903):          9f88f86c  00000001  
    D/CrashAnrDetector(  903):          9f88f870  b3b70100  
    D/CrashAnrDetector(  903):          9f88f874  00000019  
    D/CrashAnrDetector(  903): 
    D/CrashAnrDetector(  903): memory near r1:
    D/CrashAnrDetector(  903):     9c9c1018 00000000 6f6e6749 676e6972 74656d20  
    D/CrashAnrDetector(  903):     9c9c1028 74616461 6f662061 73252072 0000000a  
    D/CrashAnrDetector(  903):     9c9c1038 00564c46 6d207461 2074736f 20656e6f  
    D/CrashAnrDetector(  903):     9c9c1048 65646976 7473206f 6d616572 20736920  
    D/CrashAnrDetector(  903):     9c9c1058 70707573 6574726f 6e692064 766c6620  
    D/CrashAnrDetector(  903):     9c9c1068 0000000a 63207325 6365646f 20732520  
    D/CrashAnrDetector(  903):     9c9c1078 20746f6e 706d6f63 62697461 7720656c  
    D/CrashAnrDetector(  903):     9c9c1088 20687469 0a766c66 00000000 65646956  
    D/CrashAnrDetector(  903):     9c9c1098 0000006f 6978754d 5620676e 69203650  
    D/CrashAnrDetector(  903):     9c9c10a8 6c66206e 69772076 70206c6c 75646f72  
    D/CrashAnrDetector(  903):     9c9c10b8 66206563 7070696c 76206465 6f656469  
    D/CrashAnrDetector(  903):     9c9c10c8 206e6f20 79616c70 6b636
    D/CrashAnrDetector(  903): processName:com.streem.mobile.android
    D/CrashAnrDetector(  903): broadcastEvent : com.streem.mobile.android SYSTEM_TOMBSTONE
    

    I'd appreciate any help available in debugging the issue.

  • building ffmpeg library for android on linux

    27 juillet 2015, par Harpreet Kaur

    I am trying to install ffmpeg libaray on linux for my android application. The link which I am following is https://www.assetbank.co.uk/support/documentation/install/ffmpeg/ I have successfully completed all the steps except the last one i.e " Run "/sbin/ldconfig" as root. "

    It is showing the following error in the linux terminal: anirudh@anirudh-System-Product-Name:/sbin$ ldconfig /sbin/ldconfig.real: Can't create temporary cache file /etc/ld.so.cache~: Permission denied

    Please comment if anyone can suggest something regarding this issue.

  • FFMPEG Can't Display The Duration Of a Video

    27 juillet 2015, par Malkavian

    I'm trying to use ffmpeg to capture frames from a video file, but I can't even get the duration of a video. everytime when I try to access it with pFormatCtx->duration I'm getting 0. I know the pointer initialized and contains the correct duration because if I use av_dump_format(pFormatCtx, 0, videoName, 0); then I actually get the duration data along with other information about the video. This is what I get when I use av_dump_format(pFormatCtx, 0, videoName, 0);:

    Input #0, avi, from 'futurama.avi':

    Duration: 00:21:36.28, start: 0.000000, bitrate: 1135 kb/s

    Stream #0.0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 512x384

    [PAR 1:1 DAR 4:3], 25 tbr, 25 tbn, 25 tbc

    Stream #0.1: Audio: ac3, 48000 Hz, stereo, s16, 192 kb/s

    I don't understand why av_dum_format can display duration and I can't. I checked the function definition, to display the duration, the function also uses pFormatCtx->duration. It's not just the duration other member variables also don't display the proper data when I call them in main.cpp

    Here's my main.cpp:

    extern "C" {
        #includeavcodec.h>
        #includeavformat.h>
        #includeswscale.h>
    }
    
    
    int main(int argc, char *argv[]) {
        AVFormatContext *pFormatCtx = NULL;
    
        const char videoName[] = "futurama.avi";
    
        // Register all formats and codecs.
        av_register_all();
        cout << "Opening the video file";
        // Open video file
        int ret = avformat_open_input(&pFormatCtx, videoName, NULL, NULL) != 0;
        if (ret != 0) {
            cout << "Couldn't open the video file." << ret ;
            return -1;
        }
        if(avformat_find_stream_info(pFormatCtx, 0) < 0) {
            cout << "problem with stream info";
            return -1;
        }
    
        av_dump_format(pFormatCtx, 0, videoName, 0);
        cout << pFormatCtx->bit_rate << endl; // different value each time, not initialized properly.
        cout << pFormatCtx->duration << endl; // 0
        return 0;
    }
    

    I don't know if it helps but, I use QtCreator on Ubuntu and linked the libraries statically.

    Thank you for your help.

  • C# Using ffmpeg with binary data

    27 juillet 2015, par user3763117

    I have the need to make several posters from a movie, however I bounched in several problems.

    I have been searching yesterday whole day how this works and what might be the best solution to do this in my C# project, currently as this far.

    AForge.Video.FFMPEG.VideoFileWriter writer = new VideoFileWriter();
    writer.Open("en.code-bude_test_video.avi", width, height, 25, VideoCodec.MPEG4, 1000000);
    

    Following the documentation this should work with a local avi file, however I have my movie in binary and have no understanding how to use this stream to let the ffmpeg writer read this

    data is contained like this:

    Byte[] bytes = Convert.IsDBNull(s[col]) ? null : (Byte[])s[col];
    

    Anybody idea how to do this?