2015-08-03 14:18:15 +02:00
|
|
|
# Print file metadata etc.
|
|
|
|
ffmpeg -i path/to/file.ext
|
|
|
|
|
|
|
|
# Convert all m4a files to mp3
|
2016-09-01 02:10:21 +02:00
|
|
|
for f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -vn -b:a 320k "${f%.m4a}.mp3"; done
|
|
|
|
|
2016-09-09 02:05:08 +02:00
|
|
|
# Convert video from .foo to .bar
|
2016-09-01 02:10:21 +02:00
|
|
|
# -g : GOP, for searchability
|
2016-09-09 02:05:08 +02:00
|
|
|
ffmpeg -i input.foo -vcodec bar -acodec baz -b:v 21000k -b:a 320k -g 150 -threads 4 output.bar
|
2016-09-01 02:10:21 +02:00
|
|
|
|
|
|
|
# Convert image sequence to video
|
|
|
|
ffmpeg -r 18 -pattern_type glob -i '*.png' -b:v 21000k -s hd1080 -vcodec vp9 -an -pix_fmt yuv420p -deinterlace output.ext
|
2015-08-03 14:18:15 +02:00
|
|
|
|
2016-09-09 02:05:08 +02:00
|
|
|
# Combine video and audio into one file
|
|
|
|
ffmpeg -i video.ext -i audio.ext -c:v copy -c:a copy output.ext
|
|
|
|
|
2015-08-03 14:18:15 +02:00
|
|
|
# Listen to 10 seconds of audio from a video file
|
|
|
|
#
|
|
|
|
# -ss : start time
|
|
|
|
# -t : seconds to cut
|
|
|
|
# -autoexit : closes ffplay as soon as the audio finishes
|
|
|
|
ffmpeg -ss 00:34:24.85 -t 10 -i path/to/file.mp4 -f mp3 pipe:play | ffplay -i pipe:play -autoexit
|
2016-09-01 02:10:21 +02:00
|
|
|
|