Newest 'ffmpeg' Questions - Stack Overflow

Articles published on the website

  • Is there any way to change subtitle font in an mkv file in batches?

    30 October, by Sadao Maou

    I have been using aegis subs till now but i need to do it in batches. Is there any way to do it in batch from ffmpeg or some cli?

  • Reading RTCP packets from an IP camera using FFMPEG

    30 October, by Didac Perez Parera

    I am using the ffmpeg C library. I need to intercept RTCP packets from the camera in order to get the timestamp from the Sender Report. Is there any method or structure in the ffmpeg that gives me this information? I am completely stuck but I am not able to solve that problem.

    Any help will be appreciated. Thanks in advance,

  • Moviepy write_videofile works the second time but not the first?

    30 October, by Andrew Best

    I'm concatenating a list of video objects together then writing them with write_videofile, weirdly enough the first time I write the file, it plays fine for the first halfish then the first few frames of each clip in the file afterwards plays before freezing. But here's the odd part, If I write the exact same video object right after the first video writes, it writes just fine and plays perfectly.

    Here's my code

    from moviepy.editor import VideoFileClip, concatenate_videoclips
    clipslist = []
    clips = ['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '']
    for clip in clips:
        dlclip = VideoFileClip(clip, target_resolution=(1080, 1920))  # Download clip
    videofile = concatenate_videoclips(clipslist)
    videofile.write_videofile("final1.mp4") # Broken after the first halfish
    videofile.write_videofile("final2.mp4") # Works entirely fine.

    Any ideas? Any suggestions appreciated.

    • Sometimes when the video is small enough it seems to write the first time just fine too.
    • It seems there is no set point where it breaks, each time I write it for the first time it typically breaks at a different spot.
    • I've tried waiting for the thread to exit and sleeping after the concatenation and that doesn't seem to fix the issue.
  • How can I preview and republish a webcam stream with ffmpeg and PowerShell? (Non-blocking buffered named pipe in Powershell)

    30 October, by Marvin Irwin

    My question is a duplicate of this, except for powershell, however in the interest of avoiding the XY problem I'll describe my objective.

    I'd like to use ffmpeg to create a preview of my webcam, while broadcasting to another process which would like to use the video.

    I figure I'll created a named pipe in PowerShell, and use ffmpeg to preview the webcam with sdl while writing the output to the pipe and letting other process eavesdrop on it.

    $pipe = New-Object System.IO.Pipes.NamedPipeServerStream('webcam', [System.IO.Pipes.PipeDirection]::Out);
    ffmpeg.exe `
    -y `
    -f dshow `
    -i "video=vide_source:audio=audio_source" `
    -f mjpeg \\.\\pipe\\webcam `
    -pix_fmt yuv420p -window_x 0 -window_y 0 -f sdl :0 

    After running this command for a few seconds, ffmpeg warns me that my real-time buffer is full.

    How can I accept a pipe which accepts and emits/discards data immediately?

  • Looking for examples of ffmpeg and concat with list.txt and fade in-out

    30 October, by Plazar99

    I've been researching how to do an ffmpeg-concat with play list and fade in/out. I haven't seen an example of this combination. my current command is as follows: I'd like to fade in and out of each video clip, and there are 35-60 video clips in the .txt list. ffmpeg build is from 2016, so it doesn't have gltransition.

    ffcommand = {"-f", "concat", "-safe", "0", "-i", renderDirPath + "concatscript.txt", "-i", musicDirPath, "-map", "0:v", "-map", "1:a", "-vf", "scale=640x480", renderDirPath + "finalrender.mp4"}