Newest 'ffmpeg' Questions - Stack Overflow

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

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 = ['https://clips-media-assets2.twitch.tv/AT-cm%7C787619651.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787628097.mp4', 'https://clips-media-assets2.twitch.tv/2222789345-offset-20860.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787624765.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787539697.mp4', 'https://clips-media-assets2.twitch.tv/39235981488-offset-3348.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788412970.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787682495.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787962593.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787627256.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787573008.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788543065.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787593688.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788079881.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788707738.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788021727.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787595029.mp4', 'https://clips-media-assets2.twitch.tv/39233367648-offset-9536.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788517651.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C788087743.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787497542.mp4', 'https://clips-media-assets2.twitch.tv/39233367648-offset-9154.mp4', 'https://clips-media-assets2.twitch.tv/7109626012888880881-offset-4818.mp4', 'https://clips-media-assets2.twitch.tv/72389234-offset-760.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787774924.mp4', 'https://clips-media-assets2.twitch.tv/AT-cm%7C787565708.mp4']
    
    for clip in clips:
        dlclip = VideoFileClip(clip, target_resolution=(1080, 1920))  # Download clip
        clipslist.append(dlclip)
    
    videofile = concatenate_videoclips(clipslist)
    videofile.write_videofile("final1.mp4") # Broken after the first halfish
    videofile.write_videofile("final2.mp4") # Works entirely fine.
    videofile.close
    

    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"}