Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • Trim and merge audio and video file using ffmpeg

    30 août 2017, par falary

    I'm trying to trim an audio file and then merge it with my video file on android.

    I can merge them together with the command below

    String command[] = {"-i", mOutputFile.getAbsolutePath(), " -i", mOutputAudioFile.getAbsolutePath(), "-c:v", "copy", "-c:a", "aac","-shortest", dest.getAbsolutePath()};
    

    But i need to trim the beginning (half-second for example) of my audio file before (for synchronization issue). So if you can help me with a single command it would be perfect but maybe i can just run two ffmpeg commands successively but i don't know how to do that as well. Thanks!

  • what codecs in tag i need ?

    30 août 2017, par Виктор

    I used to ffmpeg command

    ffmpeg -y -i #FILE_NAME# -s 640x360 -f mp4 -vcodec libx264 -vpre hq -threads 0 -b 512k -bt 512k -r 25 -g 25 -acodec libfaac -ab 96k -ar 22050 #CONEVRTED_FILE_NAME#
    

    Now I don't understand what I need to use in my tag ?

    "
    

    This option does not work

  • FFMpeg audio conversion from lower to higher, increases audio by 2 seconds [migrated]

    30 août 2017, par Dilip Kumar

    I tested ffmpeg to convert a 90 kbps mp3 to 128 kbps.

    ffmpeg -i "test.mp3" -vn -ar 44100 -ac 2 -ab 128k -f mp3 "test1.mp3"
    

    Conversion works but the problem is with the audio that converted increases by 2 more seconds. The original audio is 01:36 and the converted audio becomes 01:38. I also tried with some other audios.

    Here i am trying to convert from lower to higher. But if i convert higher like 190 kbps to 128 kbps lower, then it works properly.

    Is there something wrong with the ffmpeg?

  • ffmpeg : how add watermark to all video outputs ?

    30 août 2017, par Mim Montazar

    I have a simple code that takes my video files (in my folder) and converts them to 480x360:

    for %f in (*.mp4) do ffmpeg -i "%f" -vcodec libx264 -s 352x240 -acodec copy -f mp4 "%~nf-240p.mp4" -vcodec libx264 -s 480x360 -acodec copy -f mp4 "%~nf-360p.mp4"
    

    It works correctly, but I want to add a watermark with the following options:

    -i watermark.png -filter_complex "overlay=10:10"
    

    After adding these options:

    for %f in (*.mp4) do ffmpeg -i "%f" -i watermark.png -filter_complex "overlay=10:10" -vcodec libx264 -s 352x240 -acodec copy -f mp4 "%~nf-240p.mp4" -vcodec libx264 -s 480x360 -acodec copy -f mp4 "%~nf-360p.mp4"
    

    it just adds watermark on 240p.mp4. How do I apply this filter to all files?

    Thanks.

  • Malloc Check Failed when opening video stream

    30 août 2017, par donturner

    I'm writing a BlackBerry 10 application which decodes an H264 video stream (from a Parrot AR Drone) using ffmpeg and libx264. These libraries have both been compiled for BlackBerry QNX.

    Here's my code:

    av_register_all();
    avcodec_register_all();
    avformat_network_init();
    
    printf("AV setup complete\n");
    
    const char* drone_addr = "http://192.168.1.1:5555";
    AVFormatContext* pFormatCtx = NULL;
    AVInputFormat* pInputFormat = av_find_input_format("H264");
    
    printf("Opening video feed from drone\n");
    
    //THIS LINE FAILS 
    int result = avformat_open_input(&pFormatCtx, drone_addr, pInputFormat, NULL); 
    

    The last line fails with the error:

    Malloc Check Failed: :../../dlist.c:1168
    

    How can I fix this error or debug it further?

    Update: The error only occurs when I supply pInputFormat to avformat_open_input. If I supply NULL I don't get an error. But for my app I must supply this parameter since it is not possible for ffmpeg to determine the video format from the feed alone.