Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • 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

  • Windows Batch File : for /F read only first line of mylist.txt and delete first line afterwards

    20 mai 2018, par J. J.

    I run a batch script:

    FOR /F "tokens=1" %%F IN (mylist.txt) do C:\VideoConverter\Applications\ffmpeg.exe ^
    -f image2 -loop 1 -framerate 0.1 -i "%%~F" -i "%~dpn1.mp3" -codec:v libx264 ^
    -s 1920x1080 -acodec copy -strict experimental -movflags faststart -t 00:10:10.00 ^
    -f mp4 "%~dpn1.mp4"
    

    In my folder are the following files:

    file001.mp3
    file002.mp3
    file003.mp3
    

    mylist.txt contains:

    pic001.jpg 
    pic002.jpg 
    pic003.jpg
    

    At the moment the script creates 3 videos with 3 different background images for every mp3 in the folder. This is wrong.

    I want to create only these three videos.

    video 1 = file001.mp3 + pic001.jpg (line1) 
    video 2 = file002.mp3 + pic002.jpg (line2)
    video 3 = file003.mp3 + pic003.jpg (line3)
    

    Can someone help me with the for /f command? Thank you for your help.

  • JavaCv and FFMpeg

    19 mai 2018, par Karthik Veenam

    I was given a task to merge an Image and Audio to make a video file out of them in android. I successfully finished the task by using javacv ffmpeg but after so much of compression my app size is still around 15mb. After analysing the apk, I've found that libavcodec.so is occupying 64% of the size. Since my app relies on that, I can't exclude the file. So my question is "Is it feasible to complete this task with very less apk size? Like around < 5Mb?"

  • How to fix this FFMPEG command to record audio as well ?

    19 mai 2018, par James Kowalski

    I am trying to fix this FFMPEG command to record audio.

    I have tried using the parts recommended on the official stackoverflow site but they didn't work

    Orignal Command

    ffmpeg_stream = '/usr/bin/ffmpeg -f x11grab -s 1280x720 -r 24 -i :%d+nomouse -c:v libx264 -preset superfast -pix_fmt yuv420p -s 1280x720 -threads 0 -f flv "%s"' % (xvfb.new_display, info['destination'])

    Command with attempted audio

    ffmpeg_stream = '/usr/bin/ffmpeg -f x11grab -s 1280x720 -r 24 -i :%d+nomouse -c:v libx264 -preset superfast -pix_fmt yuv420p -s 1280x720 -threads 0 -f alsa -ac 2 -i hw:0 -f flv "%s"' % (xvfb.new_display, info['destination'])