Newest 'ffmpeg' Questions - Stack Overflow

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

Les articles publiés sur le site

  • In Python - how to combine portions of two video files into one video file ?

    1er juin 2018, par James Johnson

    Using Python, how does one combine two video files and then save into one video file?

    For example: I want to combine 0:15 to 0:30 of A.mp4 with 0:10 to 0:20 of B.mp4 to create C.mp4.

    How does one do this in Python? (possibly using FFMpeg or anything else)

    Thank you!

  • OpenCV or FFMpeg Python - how to combine portions of two video files into one video file ?

    1er juin 2018, par James Johnson

    Using Python, how does one combine two video files and then save into one video file?

    For example: I want to combine 0:15 to 0:30 of A.mp4 with 0:10 to 0:20 of B.mp4 to create C.mp4.

    How does one do this in Python?

    Thank you!

  • Video overlay of several network inputs using ffmpeg

    1er juin 2018, par Hristo Ivanov

    I am writing my first program using the FFMPEG libraries, unfortunately it's not a simple one.

    What I need is to:

    • capture several network inputs(udp).
    • demux the inputs.
    • overlay the video streams.
    • mix the audio(or some other logic).
    • encode the resulting streams.
    • remux the streams and write the result to file.

    For now I am playing with the ffmpeg.exe tool trying achieve this functionality. The command I have looks like this:

    .\ffmpeg.exe -threads auto -y -i input0 -i input1 \
        -filter_complex "[0:v]scale=1920x1080[v0];[1:v]scale=480x270[v1];[v0][v1]overlay=1440:810[v2]" \
        -map [v2] -map 0:a -c:v libx264 -preset ultrafast -c:a copy output.mp4
    

    When input0 and input1 are files the resulting output is correct, on the other hand, when the inputs are udp streams the resulting output is not correct, the video freezes most of the time.

    The file inputs are generated from the udp streams, using the following command:

    .\ffmpeg.exe -threads auto -y -i "udp://@ip:port" -c copy -f mpegts input1.mpg
    

    Question 1. Why is the above command not producing good ouput for udp streams? What are the differences between the original stream and the dump of that stream for ffmpeg.exe.

    Question 2. Is there some argument/s that can fix the command?

    Question 3. What kind of logic/algorithm is needed to correctly overlay two network streams.

  • Generate a 2-fps mp4 from images using FFMPEG

    1er juin 2018, par Kagemand Andersen

    Need to create a video from a series of images. The video needs to have a low frame rate. This is the command I use to create the video.

    ffmpeg.exe -r 2 -i images/%3d.jpg -vcodec libx264 -pix_fmt yuvj420p output.mp4
    

    The problem is that, while the video works just fine when played through a HTML5 video, it doesn't really work when the file is downloaded locally and played through either the Windows 10 default video player or even VLC (weirdly, the default video player works better).

    Can anyone explain why this is happening and possibly how to fix the issue?

  • How to decode a video at a certain fps using ffmpeg

    1er juin 2018, par Mohammed_BEY

    I am working on video decoding using FFmpeg. When I try to decode a video which is encoded with h265 at a certain fps (ex: fps=25), the result is a decoded video but at a different fps. How can I decode a video at exactly fps=25, even if I have a high miss rate or dropped frames? I use this command to decode: ffmpeg -benchmark -i -f null /dev/null

    I am running the above command on Odroid-XU3 board that contains 8 cores. The OS is Ubuntu 14.04 LTS.

    Please, any help is welcome. Thank you in advance.