Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Has anyone used Azure vm's for gpu-accelerated video enc/decoding with FFmpeg/libav ?

    4 mai 2017, par user3776020

    I am trying to use NVIDIA hardware acceleration with FFmpeg/libav on a Microsoft Azure GPU vm (any of the new N-series). I am able to get it working with a comparable AWS vm, but am not having luck with Azure.

    I have a different question posted here detailing the specific problem I'm running into (Trouble with hardware-assisted encoding/decoding via FFmpeg on Azure GPU vm's (ubuntu 16.04)), but have since realized that the better question to ask is if anyone has been able to achieve it, full-stop.

    If so, would you please share the details of your environment (type of vm, os version, installation commands, etc). Thanks!

  • How to find FFMPEG file path in godaddy vps server ?

    4 mai 2017, par Kadiravan Vellingiri

    I am currently working on a Video sharing website. I am looking to automatically generate thumbnails for the videos that are uploaded. The godaddy support team helped in installing the ffmpeg library in VPS server. But when i try to upload the videos, i get the below error message

    sh: /usr/local/bin/ffmpeg: No such file or directory

    There are certain ways mentioned to find out the ffmpeg path but i am unable to proceed as i do not have much idea about SSH. Can you help me finding the easiest way to get the correct ffmpeg filepath in my server?

  • Using FFMpeg on Android to record to a RTMPS target

    4 mai 2017, par pbdev

    We're building an Android app that streams video to a Wowza server. When using the RTMP protocol everything works but when we change the protocol to RTMPS (and the port number to 443) the recorder stops after a few frames. We tried both endpoints on a MacBook (streaming the build-in webcam) and that just works well so the endpoints are fine.

    rtmp://my.streamlock.net:1935/app/stream
    rtmps://my.streamlock.net:443/app/stream
    

    Here is some of the build.gradle file:

    configurations {
        all*.exclude group: 'org.bytedeco', module: 'javacpp-presets'
    }
    
    dependencies {
        compile group: 'org.bytedeco', name: 'javacv', version: '1.3.2'
        compile 'org.bytedeco.javacpp-presets:opencv:3.2.0-1.3.2:android-arm'
        compile 'org.bytedeco.javacpp-presets:opencv:3.2.0-1.3.2:android-x86'
    }
    

    The record method on the FFmpegFrameRecorder instance gets called 30 times per second. After 7 or 8 frames the record method freezes for a minute and then records another 7 or 8 frames. No exceptions are thrown, the app just does 'nothing'. Here are some debugging logs:

    D/Recorder: Calling the record method
    I/System.out: Predeallocating org.bytedeco.javacpp.BytePointer[address=0xcb480000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$2@63f04a2]
    I/System.out: Registering org.bytedeco.javacpp.BytePointer[address=0xcb480000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xcb480000,deallocatorAddress=0xcdcce000]]
    I/System.out: Collecting org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xe952f478,deallocatorAddress=0xcf750090]
    D/Recorder: Record method done
    D/Recorder: Calling the record method
    I/System.out: Predeallocating org.bytedeco.javacpp.BytePointer[address=0xcb100000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$2@38a8533]
    I/System.out: Registering org.bytedeco.javacpp.BytePointer[address=0xcb100000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xcb100000,deallocatorAddress=0xcdcce000]]
    D/Recorder: Record method done
    D/Recorder: Calling the record method
    I/System.out: Predeallocating org.bytedeco.javacpp.BytePointer[address=0xcad00000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$2@f0270f0]
    I/System.out: Registering org.bytedeco.javacpp.BytePointer[address=0xcad00000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xcad00000,deallocatorAddress=0xcdcce000]]
    D/Recorder: Record method done
    D/Recorder: Calling the record method
    I/System.out: Predeallocating org.bytedeco.javacpp.BytePointer[address=0xcab00000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$2@c136669]
    I/System.out: Registering org.bytedeco.javacpp.BytePointer[address=0xcab00000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xcab00000,deallocatorAddress=0xcdcce000]]
    D/Recorder: Record method done
    D/Recorder: Calling the record method
    I/System.out: Predeallocating org.bytedeco.javacpp.BytePointer[address=0xca900000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$2@bacc8ee]
    I/System.out: Registering org.bytedeco.javacpp.BytePointer[address=0xca900000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xca900000,deallocatorAddress=0xcdcce000]]
    D/Recorder: Record method done
    D/Recorder: Calling the record method
    I/System.out: Predeallocating org.bytedeco.javacpp.BytePointer[address=0xca700000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$2@3de418f]
    I/System.out: Registering org.bytedeco.javacpp.BytePointer[address=0xca700000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xca700000,deallocatorAddress=0xcdcce000]]
    D/Recorder: Record method done
    D/Recorder: Calling the record method
    I/System.out: Predeallocating org.bytedeco.javacpp.BytePointer[address=0xca500000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$2@135ac1c]
    I/System.out: Registering org.bytedeco.javacpp.BytePointer[address=0xca500000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xca500000,deallocatorAddress=0xcdcce000]]
    D/Recorder: Record method done
    D/Recorder: Calling the record method
    I/System.out: Predeallocating org.bytedeco.javacpp.BytePointer[address=0xca300000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$2@7f30025]
    I/System.out: Registering org.bytedeco.javacpp.BytePointer[address=0xca300000,position=0,limit=921603,capacity=921603,deallocator=org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xca300000,deallocatorAddress=0xcdcce000]]
    I/System.out: Collecting org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xcb100000,deallocatorAddress=0xcdcce000]
    I/System.out: Collecting org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xca500000,deallocatorAddress=0xcdcce000]
    I/System.out: Collecting org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xca700000,deallocatorAddress=0xcdcce000]
    I/System.out: Collecting org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xca900000,deallocatorAddress=0xcdcce000]
    I/System.out: Collecting org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xcab00000,deallocatorAddress=0xcdcce000]
    I/System.out: Collecting org.bytedeco.javacpp.Pointer$NativeDeallocator[ownerAddress=0xcad00000,deallocatorAddress=0xcdcce000]
    

    After the NativeDeallocator nothing happens for a minute and then the same repeats. Any help would be greatly appreciated!

  • YUV8_420P - AVFrame conversion hazard (only Y plan)

    4 mai 2017, par Flow

    I'm working on a FFMPEG application. The goal is to convert a picture (YUV input format) to an AVFrame to be able to process it (by applying a specific filter) and then realize the invert conversion to redirect it to the output.

    Although some filters as drawgrid or noise are perfectly working, filters which apply some "space transformation" (as a "crop" or a "hflip") seem to affect only over the Y component. The colors of the output pictures aren't filtered which leads to an unsatisfying result.

    I'm asking myself why I have such a result but I didn't reach to find the problem origin.

    Here is the part of cod which convert the YUV picture to an AVFrame:

    unsigned int i = 0;
    int number_common_channels = MIN(IMAGEFORMAT_COMPONENTS, AV_NUM_DATA_POINTERS);
    
    // Transfer the image informations (width, height, pitch and data)
    if ((av_im->width = yuv_im->width[0]) <= 0)
    {
        cu_printf(ERROR, "Width of destination picture null or negative");
        return -1;
    }
    if((av_im->height = yuv_im->height[0]) <= 0)
    {
        cu_printf(ERROR, "Height of destination picture null or negative");
        return -1;
    }
    for (i=0; i < number_common_channels; i++)
    {
        av_im->linesize[i] = yuv_im->pitch[i];
        av_im->data[i] = yuv_im->data[i];
    }
    

    If necessary, I can transmit you other parts of the cod where the problem could be. Thanks for your cooperation.

    Flow.

    EDIT 1: After some researches, it would be possible the problem came from my function which initializes the filter graph. Actually, I used the FFMPEG example given on their website to make it and I deleted the options to the pixel format list because I thought it was useless. It's possible this function and more precisely the av_opt_set_int_list could be the key, but I don't reach to find a good example using it. Also, another function, av_opt_set_pixel_fmt was created in the last FFMPEG versions and this could be well to try using it, but I don't know how to do. So please if someone has a good example with that, I'll took it with hapiness.

    EDIT 2: The problem came from the way I copied my data back after the filter was applied. Closed.

  • Decode 16 kHz PCM aLaw with ffmpeg

    4 mai 2017, par Jim Rhodes

    I have an application that receives an RTP stream from an IP camera and decodes it with ffmpeg and I am having a problem with a particular audio format.

    If I configure the camera for G.711A at 8 kHz audio decodes correctly. If I configure the camera for G.711A at 16 kHz audio plays at the wrong pitch. It plays at the correct speed but voices are very low pitch. The camera sends a=rtpmap:8 PCMA/16000 for the audio track and I set up ffmeg like this:

    AVPacket avpkt;
    AVCodec* pCodec;
    AVCodecContext* pContext;
    AVFrame* pFrame;
    
    . . .
    
    av_init_packet(&avpkt);
    pCodec = avcodec_find_decoder(AV_CODEC_ID_PCM_ALAW);
    if ( pCodec )
    {
        pContext = avcodec_alloc_context3(pCodec);
        pContext->bits_per_coded_sample = 16;
        pContext->sample_rate = 16000;
        pContext->channels = 1;
        if ( avcodec_open2(pContext, pCodec, NULL) >= 0)
        {
            pFrame = av_frame_alloc();
        }
    }
    

    As audio data is received I use avcodec_decode_audio4 to decode the stream and pass the output to an audio device that accepts PCM16.

    Should ffmpeg be able to decode this format and if so is there anything else I need to set up?