Recherche avancée

Médias (3)

Mot : - Tags -/spip

Autres articles (69)

Sur d’autres sites (11726)

  • How to split a video using black frames as markers in ffmpeg ?

    13 décembre 2019, par gramm

    I want to split a video so that when there are black frames it creates a new file.
    Is there a way to do this in one command in ffmpeg ?
    I can for the moment detect black frames using :

    ffmpeg -i myfile -vf blackdetect=d=2:pix_th=0.00 -f rawvideo -y /NUL

  • FFmpeg uses too much memory when repeating split, select, overlay

    13 novembre 2020, par finefoot

    I'm running

    


    ffmpeg -i input.mp4 -filter_complex_script script.txt output.mp4


    


    with the following minimal example script :

    


    split[tmp],
select='between(t,1,2)',
select='between(n,0,1)',
[tmp]overlay=enable='between(t,1,2)':eof_action=repeat,
split[tmp],
select='between(t,3,4)',
select='between(n,0,1)',
[tmp]overlay=enable='between(t,3,4)':eof_action=repeat


    


    What I want to do is to take 1 frame at a certain position and repeat it for a certain duration, basically "pausing" the video, while overwriting to keep the same output length. In the example, I'm doing this twice : I'm using split[tmp] to get a second input stream to work on, select the time at position 00:01 with select='between(t,1,2)', select the first frame from that position with select='between(n,0,1)' and finally overlay that frame over the input. This repeats for a second time at position 00:03. I have tested this and it does exactly what I'm looking for.

    


    However, in my real script, I'm repeating this about 1000 times for different positions in the stream (and for shorter durations than 1 second) which results in running out of memory. What am I doing wrong ? What can I do to optimize ?

    


  • How to split a video into multiple n-second GIFs ?

    26 mai 2021, par ftgp

    I read a lot of tutorials and I could do this command :

    


    ffmpeg -t 3 -i video.mp4 -vf "fps=15,scale=360:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif


    


    But it won't work to do what I want. I need to read a video.mp4 and create multiple GIFs with two or three seconds for each two or three seconds of the video, until the end.