ffmpeg -i input.mp3 output.wma
ffmpeg -formats
ffmpeg -i input.wav -ac 1 -ab 64000 -ar 22050 output.mp3
ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 16000 out.wav
ffmpeg -i 111.mp3 -acodec pcm_s16le -ac 1 -ar 22050 out.wav
cd into dir for batch process:
for i in *.mp3; do ffmpeg -i "$i" -acodec pcm_s16le -ac 1 -ar 22050 "${i%.mp3}-encoded.wav"; done
ffmpeg -i input.mp3 -ss 60 -t 30 output.wav
ffmpeg -i input.mp3 -ss 0:01:00 -t 0:00:30 output.wav
ffmpeg -i somefile.mp3 -f segment -segment_time 3 -c copy out%03d.mp3
ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac
vn
is no video.
acodec
copy says use the same audio stream that's already in there.ffmpeg -i video.mp4 -f mp3 -ab 192000 -vn music.mp3
ffmpeg -i INPUT.mp4 -codec copy -an OUTPUT.mp4
ffmpeg -i 36.MOV -i 36.wav -map 0:v -map 1:a -c copy -y 36-encoded.mov
or add an offset to audio
ffmpeg -i 36.MOV -itsoffset -0.25 -i 36.wav -map 0:v -map 1:a -c copy -y 36-encoded.mov
or
ffmpeg -i INPUT.mp4 -i AUDIO.wav -shortest -c:v copy -c:a aac -b:a 256k OUTPUT.mp4
ffmpeg -i videofile.mp4 -vn -acodec libvorbis audiofile.ogg
for vid in *.mp4; do ffmpeg -i "$vid" -vn -acodec libvorbis "${vid%.mp4}.ogg"; done
-acodec libmp3lame
and change the extension from .ogg
to .mp3
for mp3 encoding.ffmpeg -i videofile.mp4 -vn -acodec copy audiofile.mp3
for file in *; do ffprobe $file 2>&1 |grep Audio; done
for file in *mp4 *avi; do ffmpeg -i "$file" -vn -acodec copy "$file".
ffprobe "$file" 2>&1 |sed -rn 's/.Audio: (...), ./\1/p'; done
$ mkdir newfiles
$ for f in *.m4a; do ffmpeg -i "$f" -codec:v copy -codec:a libmp3lame -q:a 2 newfiles/"${f%.m4a}.mp3"; done
ffmpeg -i input.m4a -acodec libmp3lame -ab 128k output.mp3
m4a to mp3 conversion with ffmpeg and lamefor f in *.m4a; do ffmpeg -i "$f" -acodec libmp3lame -ab 256k "${f%.m4a}.mp3"; done
$ vf [ss][filename][outputFileName]
where vf
is a custom bash script as follows:
$ ffmpeg -ss $1 -i $2 -qmin 1 -q:v 1 -qscale:v 2 -frames:v 1 -huffman optimal $3.jpg
ss offset = frame number divided by FPS of video = the decimal (in milliseconds) ffmpeg needs i.e. 130.5ls * | perl -ne 'print "file $_"' | ffmpeg -f concat -i - -c copy merged.mp4
$ ffmpeg -i video.flv image%d.jpg
$ ffmpeg -f image2 -i image%d.jpg imagestovideo.mp4
$ ffmpeg -i image-%03d.png -c:v libx264 -pix_fmt yuv420p test.mp4
$ ffmpeg -r 1/5 -i image-%03d.png -c:v libx264 -vf fps=25 -pix_fmt yuv420p test.mp4
$ ffmpeg -loop 1 -i image.png -c:v libx264 -t 60 -pix_fmt yuv420p -vf scale=1920:1080 out.mp4
$ ffmpeg -framerate 30 -pattern_type glob -i '*.jpeg' -c:v libx264 -pix_fmt yuv420p gan-1.mov
ffmpeg -i input.mov -vcodec libx264 -pix_fmt yuv420p output.mp4
$ ffmpeg -i example.mp4 -f webm -c:v libvpx -b:v 1M -acodec libvorbis example.webm -hide_banner
more infoffmpeg -i audio.xxx -c:a flac audio.flac
ffmpeg -i video.mp4 -map_channel 0.1.0 -c:v copy mono.mp4
Left channel to stereo:
ffmpeg -i video.mp4 -map_channel 0.1.0 -map_channel 0.1.0 -c:v copy stereo.mp4
If you want to use the right channel, write 0.1.1
instead of 0.1.0.
ffmpeg -t 30 -i inputfile.mp3 -acodec copy outputfile.mp3
ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -c copy cut_video.mp4
ffmpeg -i source.mp4 -ss 00:00:05 -t 00:00:10 -async 1 -strict -2 cut_video.mp4
ffmpeg -i input.mov -vcodec libx264 -crf 24 output.mp4
It reduced a 100mb video to 9mb.. Very little change in video quality.ffmpeg -i video.mov -vf eq=saturation=0 -s 640x480 -c:v libx264 -crf 24 output.mp4
make a grayscale version and scale to 640x480ffmpeg -i file.mkv
check for streams that you want (video/audio). be sure to convert/specify DTS 6 channel audio stream
ffmpeg -i input.mkv -strict experimental -map 0:0 -map 0:1 -c:v copy -c:a:1 libmp3lame -b:a 192k -ac 6 output.mp4
ffmpeg -i source.mov -i watermark.png -filter_complex "overlay=x=(main_w-overlay_w)/2:y=(main_h-overlay_h)/2" output.mp4