Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • ffmpeg parse error with bass audio filter and expression evaluation

    23 août 2018, par Shaun

    I am trying to dynamically change the bass of an audio file as a function of time. For instance, say I would like to gradually increase the bass over a period of 5 seconds. The command I am using is

    ffmpeg -y -i in.wav -af \
        "bass=g='if(lte(t,5),-20+(20/5)*t,0)':width_type=q:w=0.70" \
        out.wav
    

    However I am receiving the error

    [bass @ 0x19890c0] [Eval @ 0x7ffd8e143630] Unknown function in 't,5),-20+(20/5)*t,0)'
    

    As a second attempt, I instead tried to use min instead of lte, the command being

    ffmpeg -y -i in.wav -af \
        "bass=g='min(-20+20*t/5,0)':width_type=q:w=0.70" \
         out.wav
    

    but got a slightly different error

    [bass @ 0x263d040] [Eval @ 0x7fff0c8e7dc0] Invalid chars '(-20+20*t/5,0)' at the end of expression 'min(-20+20*t/5,0)'
    
  • Changing Audio Volume using FFmpeg Android

    23 août 2018, par kataroty

    As I have understood, the only way to change FFmpeg volume is to do it throught a command line.

    This is what should change the volume of the audio :

    ffmpeg -i input.wav -filter:a "volume=1.5" output.wav
    

    Now I have used FFmpeg with command line before and it looked like this and gave me no errors:

        String[] cmd = { "-i" , pcmtowavTempFile.toString(), "-i", mp3towavTempFile.toString(), "-filter_complex", "amix=inputs=2:duration=first:dropout_transition=3", combinedwavTempFile.toString()};
        ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
            @Override
            public void onSuccess(String message) {                
                super.onSuccess(message);
                encodeWavToAAC();
            }
            @Override
            public void onFailure(String message) {
                super.onFailure(message);
                onError(message);
            }
        });
    

    But If I try to do it with audio volume in the same method, it just ignores it :

        String[] cmd = { "-i" , pcmtowavTempFile.toString(),  "-filter:a", "volume=1.3", pcmtowavTempFile.toString()};
        ffmpeg.execute(cmd, new ExecuteBinaryResponseHandler() {
            @Override
            public void onSuccess(String message) {
                super.onSuccess(message);
            }
            @Override
            public void onFailure(String message) {
                super.onFailure(message);
    
            }
        });
    

    I get neither, no success or error message with the last volume change method.

    Since the volume is there between " ", I tried adding this :

    String[] cmd = { "-i" , pcmtowavTempFile.toString(),  "-filter:a", "\"volume=1.3\"", pcmtowavTempFile.toString()};
    

    But the app started crashing after adding this line.

  • FFMPEG download m3u8 faster

    23 août 2018, par Bruno Andrade

    I have a server with 1 Gbps port speed where I am trying to download m3u8 videos from a website. But he is very slow. I want to know if there is something in my ffmpeg code that I can do to make it get faster?

    ffmpeg -hide_banner -loglevel verbose -n -i http://example.com/list.m3u8 -map 0:4 -map 0:5 -acodec copy -bsf:a aac_adtstoasc -vcodec copy video.mp4 1> log.tx  2>&1
    

    Does the CPU influence this type of ffmpeg download? What I understand of the code is that it is saying not to encode anything. Download the same video is on the site. So CPU processing would not influence the speed correct?

  • FFMPEG outputs stream to UDP port, but no packets received on that port

    23 août 2018, par user10260735

    I am a bit new to FFMPEG and will appreciate any help I can get! Basically, I am trying to transcode a 'webm' UDP stream to Opus audio stream, and then finally output that to a specific UDP port on my network.

    This is the command I am using:

    ffmpeg -re -i udp://127.0.0.1:2222 -vn -map 0:a -c:a libopus -f ogg udp://127.0.0.1:2224
    

    However, when I check on port 2224, I do not receive any packets.

    FFMPEG is definitely receiving the input packets because if I run the following command, the file plays out perfectly:

    ffmpeg -re -i udp://127.0.0.1:2222 -vn -map 0:a -c:a libopus -f test.opus
    

    Does anyone have any suggestions on what mistake I am making?

  • fluent-ffmpeg video merge with hardware acceleration using NVIDIA graphics card

    23 août 2018, par krisalay

    I am trying to concatenate videos to one single .mp4 file.

    If I am not using hardware acceleration then the merge is working fine.

    However, when I provide -hwaccel cuvid as inputOptions and -c:v h264_nvenc as outputOptions then it throws error:

    ffmpeg exited with code 1: Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

    The code:

    ffmpeg
    .input('video1.mp4')
    .input('video2.mp4')
    .inputOptions(['-loglevel error','-hwaccel cuvid'])
    .outputOptions('-c:v h264_nvenc')
    .mergeToFile('filepath.mp4')
    

    What could be the possible reason for the error? And what can be the solution to resolve the error?