Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • FFmpeg - Down-mix AC3 5.1 to Fraunhofer FDK ACC 2.1

    20 mai 2018, par Aida_Aida

    I'm trying to re-encode some of my old videos to "archive" them.

    I do not need to keep the audio 5.1, but I would like to down-mix it to 2.1 instead of Stereo which sounds just too dull.

    This is the relevant part which takes care of the down-mix to Stereo and re-encodes the audio, I would like to adjust it to down-mix to 2.1.

    -ac 2 -c:a libfdk_aac -vbr 3
    

    I did some research and it seems that there is a -layouts switch which does support 2.1, but I don't know, how to use it. What channel should go where?

    Just for illustration and for you to get the whole picture - I'm currently using this script:

    #!/bin/bash
    for i in *.mkv;
    do 
        #Output new files by prepending "x265" to the names
    
        /cygdrive/c/media-autobuild_suite/local32/bin-video/ffmpeg.exe -y -i "$i" -c:v libx265 -preset slow -b:v 512k -x265-params pass=1 -c:s copy -c:a copy -f matroska NUL && \
        /cygdrive/c/media-autobuild_suite/local32/bin-video/ffmpeg.exe    -i "$i" -c:v libx265 -preset slow -b:v 512k -x265-params pass=2 -c:s copy -ac 2 -c:a libfdk_aac -vbr 3 x265_"$i"
    
    done
    
  • How should one start with ffmpeg's API ?

    20 mai 2018, par JoeDough

    I'd like to make a real time streaming program that takes input from a webcamera, ffmpeg looks like a good library for encoding a stream of images but there is no documentation or community tutorials (there is just a doxygen API reference).Where should I start if there's no official documentation?

  • youtube-dl sometime hangs with "[ffmpeg] Correcting container"

    20 mai 2018, par user292344

    Ubuntu 16.04

    /usr/local/bin/youtube-dl --version
    2018.05.09
    

    I have a bash script that attemts to download a youtube video. The output is below. The problem is that sometimes it works perfectly (completes quickly). But most of the time it hangs on "Correcting container....". Does anyone know why?

    + /usr/local/bin/youtube-dl --verbose -x 'https://www.youtube.com/watch?v=8HVWitAW-Qg'
    
    [debug] System config: []
    
    [debug] User config: []
    
    [debug] Custom config: []
    
    [debug] Command-line args: [u'--verbose', u'-x', u'https://www.youtube.com/watch?v=8HVWitAW-Qg']
    
    [debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
    
    [debug] youtube-dl version 2018.05.09
    
    [debug] Python version 2.7.12 (CPython) - Linux-4.4.0-124-generic-x86_64-with-Ubuntu-16.04-xenial
    
    [debug] exe versions: avconv 2.8.14-0ubuntu0.16.04.1, avprobe 2.8.14-0ubuntu0.16.04.1, ffmpeg 2.8.14-0ubuntu0.16.04.1, ffprobe 2.8.14-0ubuntu0.16.04.1, rtmpdump 2.4
    
    [debug] Proxy map: {}
    
    [youtube] 8HVWitAW-Qg: Downloading webpage
    
    [youtube] 8HVWitAW-Qg: Downloading video info webpage
    
    [youtube] 8HVWitAW-Qg: Extracting video information
    
    [debug] Invoking downloader on u'https://r5---sn-5uaeznkl.googlevideo.com/videoplayback?expire=1526159728&source=youtube&key=yt6&mime=audio%2Fmp4&sparams=clen%2Cdur%2Cei%2Cgir%2Cid%2Cinitcwndbps%2Cip%2Cipbits%2Citag%2Ckeepalive%2Clmt%2Cmime%2Cmm%2Cmn%2Cms%2Cmv%2Cpl%2Crequiressl%2Csource%2Cusequic%2Cexpire&keepalive=yes&lmt=1518142590597815&dur=231.131&mv=m&mt=1526137933&ms=au%2Conr&signature=18BB34F3716B412AC5757872DD2AF402B6EE20D2.43D2E68B5A5ED2E2D3076DF9264B9BB723484821&ip=71.81.217.251&c=WEB&initcwndbps=1583750&mn=sn-5uaeznkl%2Csn-p5qs7n7l&clen=3671757&gir=yes&id=o-AOxj8Rg2IuZek8KwvgPy-N7_FSGzxQ0Zl2HX1T4gepLf&ipbits=0&fvip=5&ei=EAX3WqbOH8fg4QSlkrGoAg&pl=20&mm=31%2C26&itag=140&usequic=no&requiressl=yes&ratebypass=yes'
    
    [download] Destination: Top 10 cute kitten videos compilation-8HVWitAW-Qg.m4a
    
    [download] 100% of 3.50MiB in 00:00
    
    [ffmpeg] Correcting container in "Top 10 cute kitten videos compilation-8HVWitAW-Qg.m4a"
    
    [debug] ffmpeg command line: avconv -y -i 'file:Top 10 cute kitten videos compilation-8HVWitAW-Qg.m4a' -c copy -f mp4 'file:Top 10 cute kitten videos compilation-8HVWitAW-Qg.temp.m4a'
    
    ^C
    ERROR: Interrupted by user
    
  • Failed to hard-ware accelerate video decoding via Tesla P40

    20 mai 2018, par Potemkin

    While I am writing a surveillance video recognition demo, I find it is much slower to simply play a video in the server(Xeon E5-2680 2.4GHz, Tesla P40) than in my laptop(i7-8550 1.8GHz, Intel UHD Graphics 620).

    I use DXVA-Checker to see the video decoder device, and notice that my laptop use the GPU for decoding, but the server use no GPU for the job. Then I check 'nvidia-smi', and it shows all of GPUs are running in TCC driver model, not WDDM driver model. And I cannot turn it to WDDM because nvidia-smi says it is not supported.

    The video play demo is written via OPENCV, in which the video decoding part is from ffmpeg. The server runs in Windows-server-2012, and my laptop is on Windows 10.

    The question is how can I get the server decoding videos with GPUs, and is this the reason for the slowness or there is something else?

  • Why am I unable to scale a 4-second 60 fps clip down to exactly 1 second ?

    20 mai 2018, par joeycato

    I'm currently using the setpts filter to speed up or slow down different clips and accuracy is very important to me ( context: I'm concatenating these into a final clip that needs to be perfectly in sync with a separate video.) I've been using this as a general approach:

    setpts=(targetDuration/totalFrameCount)*N/TB" -r targetDuration/totalFrameCount
    

    While it's fairly accurate most of the time, I'm wondering if I can get better results. For example, if I attempt to scale a 4-second 60fps clip down to exactly 1 second, i.e.:

    ffmpeg -y -i clip_4sec.avi -filter:v "setpts=(1/240)*N/TB" -r 240/1 clip_4sec_scaled_to_1sec.avi

    I actually end up with a 992ms clip. Does anyone know why this happening? From my understanding, as long as the target duration is a multiple of frame duration ( 1/60 seconds ) this shouldn't be an issue, correct?

    Is there a better approach I can take to improve the accuracy?

    Note: FWIW I already double-checked that the input clip has an actual frame count of 240