all 6 comments

[–]happysmash27 5 insightful - 2 fun5 insightful - 1 fun6 insightful - 2 fun -  (0 children)

I love ffmpeg! I once used it to stitch together video and audio of multiple resolutions, with one long, complicated command, because after you get used to it enough, it can actually be easier to use than the Blender video editor! I'm not sure if this is a compliment to ffmpeg or a complaint about the Blender video editor, though...

Edit: I prefer not to share that specific video due to licensing issues, but this one used this similar script:

ffmpeg -i out.ogv -r 60 -f image2 -s 1920x1080 -i Blends/Ciudad/%04d.png -i Ciudad.ogg -loop 1 -framerate 60 -t 8 -i Blends/Trajnoj/Radoj/lokomativo.png -filter_complex "[0:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [cxefa];\
[1:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [dezertu];\
[3:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [lokomativo];\
[cxefa][dezertu][lokomativo]concat=n=3:v=1:a=0[outv];\
[0:a:0][2:a:0]concat=n=2:v=0:a=1[outa]" -map "[outv]" -map "[outa]" -r 60 ciudad2.mp4

(the actual editing is mainly at the end, by the way)

Edit: Ah, I finally found the script for my complicated mix of videos and images in many different resolutions and audio of many different lengths:

ffmpeg -i DY_1.flac -loop 1 -t 19.5 -framerate 60 -i DaddyYankee.jpg -loop 1 -t 21 -framerate 60 -i hermanos.png -loop 1 -t 8 -framerate 60 -i Mireddys.jpg -loop 1 -t 4 -framerate 60 -i Yamilette.jpg -loop 1 -t 3.5 -framerate 60 -i Jeremy.jpg -loop 1 -t 5 -framerate 60 -i Jesaaelys.jpg -loop 1 -t 17 -framerate 60 -i Daddy-Yankee.jpg -ss 68 -t 5 -i Daddy\ Yankee\ -\ Latigazo-oX8aAjtRZrc.mkv -i DY_2.flac -loop 1 -t 1.95 -framerate 60 -i DaddyYankee.jpg -i Daddy\ Yankee\ \ \ Rompe\ HQ-1QzlcmHjTCo.mkv -i DY_3.flac -loop 1 -t 1.51 -framerate 60 -i DaddyYankee.jpg -i Pose\ -\ Daddy\ Yankee\ \(Official\ Cartel\ version\)-dn28nlMOYfg.mp4 -i DY_4.flac -loop 1 -t 1.57 -framerate 60 -i DaddyYankee.jpg -i Daddy\ Yankee\ _\ Dura\ \(Video\ Oficial\)-sGIm0-dQd8M.mkv -i DY_5.flac -loop 1 -t 14.81 -framerate 60 -i DaddyYankee.jpg -i Luis\ Fonsi\ -\ Despacito\ ft.\ Daddy\ Yankee-kJQP7kiw5Fk.mkv -i DY_6.flac -loop 1 -t 0.81 -framerate 60 -i DaddyYankee.jpg -filter_complex "[1:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [DaddyYankee];\
 [2:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [hermanos];\
 [3:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Mireddys];\
 [4:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Yamilette];\
 [5:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Jeremy];\
 [6:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Jesaaelys];\
 [7:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Daddy-Yankee];\
 [8:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Latigazo];\
 [10:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Daddy-Yankee_2];\
 [11:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Rompe];\
 [13:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Daddy-Yankee_3];\
 [14:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Pose];\
 [16:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Daddy-Yankee_4];\
 [17:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Dura];\
 [19:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Daddy-Yankee_5];\
 [20:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Despacito];\
 [22:v:0]scale=1920:1080:force_original_aspect_ratio=decrease,\
 pad=1920:1080:(ow-iw)/2:(oh-ih)/2, setdar=16/9 [Daddy-Yankee_6];\
 [DaddyYankee][hermanos][Mireddys][Yamilette][Jeremy][Jesaaelys][Daddy-Yankee][Latigazo][Daddy-Yankee_2][Rompe][Daddy-Yankee_3][Pose][Daddy-Yankee_4][Dura][Daddy-Yankee_5][Despacito][Daddy-Yankee_6]concat=n=17:v=1:a=0[outv];\
 [0:a:0][8:a:0][9:a:0][11:a:0][12:a:0][14:a:0][15:a:0][17:a:0][18:a:0][20:a:0][21:a:0]concat=n=11:v=0:a=1[outa]" -map "[outv]" -map "[outa]" -r 60 provo.mp4 


#scale=(iw*sar)*min(1920/(iw*sar)\,1080/ih):ih*min(1920/(iw*sar)\,1080/ih),\
 #pad=1920:1080:(1920-iw*min(1920/iw\,1080/ih))/2:(1080-ih*min(1920/iw\,1080/ih))/2

[–]sawboss 5 insightful - 1 fun5 insightful - 0 fun6 insightful - 1 fun -  (0 children)

Instead of

ffmpeg -i FILE -hide_banner 

you can just use

ffprobe FILE -hide_banner

which also avoids the At least one output file must be specified error message.

Here's how to take a screenshot with ffmpeg

ffmpeg -f x11grab -video_size 1920x1080 -i $DISPLAY -vframes 1 screen.png

Replace 1920x1080 as appropriate.

More tips:

https://wiki.archlinux.org/index.php/FFmpeg

[–]fred_red_beans 4 insightful - 2 fun4 insightful - 1 fun5 insightful - 2 fun -  (0 children)

I used ffmpeg to convert my iTunes library to flac

[–]solder0 4 insightful - 1 fun4 insightful - 0 fun5 insightful - 1 fun -  (0 children)

Debian user here; I had to increase the number of repositories to be able to install it. Good thing I did, it's a good tool.

[–]Intuit 3 insightful - 1 fun3 insightful - 0 fun4 insightful - 1 fun -  (1 child)

For me ffmpeg is a way to avoid re-encoding video while doing useful things (because for one I have a pretty slow PC):

  • split audio off, edit it, then rejoin it
  • combine multiple dashcam clips without re-encoding
  • trim dashcam clips down without having to open a big video editing app (that would probably re-encode)
  • set the orientation flag when it's upside-down, again to avoid re-encoding before uploading to YouTube

One time I downloaded a 1080p movie and the audio was clicky, so I downloaded the 720p resolution version and combined its good audio with the 1080p version's video, no re-encoding.

[–]useless_aether[S] 2 insightful - 1 fun2 insightful - 0 fun3 insightful - 1 fun -  (0 children)

excellent examples, thanks