• ferozkosicOP
    link
    fedilink
    slovenčina
    arrow-up
    2
    ·
    edit-2
    6 months ago

    dobry den hubari! vitaje v rubrike “ucime sa ffmpeg”!

    video: nejaky hrib co som nasiel na internetoch

    hudba: Ayanoid /* celkom super muzika :) */

    kazdy velmi dobre vieme ze na editovanie videa je graficke rozhranie zbytocne (bloat!!!), preto dnesny majak rotuje a vyzaruje svetlo lodiam pomocou sily command line! editovanie tohto videa bolo tak jednoduche, ze prikaz sa mi zmesil do jedneho riadku (takzvany “one-liner”)

    yt-dlp 'https://youtube.com/watch?v=0wsDzwGtHVk' -o lighthouse.webm && yt-dlp -x -f 'ba' --audio-format mp3 -o 'audio.mp3' 'https://youtube.com/watch?v=3Qsi75NYKMY' && ffmpeg -i lighthouse.webm -filter:v "setpts=0.02*PTS" -to 00:00:00.5 output_spin_fast.mp4 && ffmpeg -stream_loop -1 -i output_spin_fast.mp4 -filter_complex "[0:v]trim=0:24.2,setpts=PTS-STARTPTS[v];[0:a]atrim=0:24.2,asetpts=PTS-STARTPTS[a]" -map "[v]" -map "[a]" -shortest output_sp_fast_loop1.mp4 && ffmpeg -stream_loop -1 -i output_spin_fast.mp4 -filter_complex "[0:v]trim=0:08.0,setpts=PTS-STARTPTS[v];[0:a]atrim=0:08.0,asetpts=PTS-STARTPTS[a]" -map "[v]" -map "[a]" -shortest output_sp_fast_loop2.mp4 && ffmpeg -stream_loop -1 -i lighthouse.webm -filter_complex "[0:v]trim=0:24.2,setpts=PTS-STARTPTS[v];[0:a]atrim=0:24.2,asetpts=PTS-STARTPTS[a]" -map "[v]" -map "[a]" -shortest output_firstpart.mp4 && ffmpeg -stream_loop -1 -i lighthouse.webm -filter_complex "[0:v]trim=0:01.0,setpts=PTS-STARTPTS[v];[0:a]atrim=0:01.0,asetpts=PTS-STARTPTS[a]" -map "[v]" -map "[a]" -shortest output_middle.mp4 && echo "file 'output_firstpart.mp4'" > concatfile && echo "file 'output_sp_fast_loop1.mp4'" >> concatfile && echo "file 'output_middle.mp4'" >> concatfile && echo "file 'output_sp_fast_loop2.mp4'" >> concatfile && ffmpeg -f concat -i concatfile -c copy combined.mp4 && ffmpeg -i combined.mp4 -i audio.mp3 -filter_complex "[1:a]atrim=60:120,asetpts=PTS-STARTPTS[aud];[0:a][aud]amix=inputs=2:duration=first:dropout_transition=2[a]" -map 0:v -map "[a]" -ss 0:00 -t 1:00 -c:v copy velmi_rad_mam_majaky_a_pridu_mi_vtipne.mp4 && mpv velmi_rad_mam_majaky_a_pridu_mi_vtipne.mp4
    

    tymto prikazom si mozete toto video zostavit a spustit aj sami doma v obyvacke alebo na ostrove kde strazite majak, len pozor aby vam z toho nesplechlo.