Open ajhsu opened 7 years ago
Using AAC
ffmpeg -i input.mp3 -c:a aac -b:a 128k output.m4a
Using libfaac
ffmpeg -i Kalimba.mp3 -c:a libfaac -vn Kalimba.m4a
curl -i -F name=m.m4a -F file=@m.m4a "https://uguu.se/api.php?d=upload-tool"
ffmpeg -i "https://fs-preview.kfs.io/201307/0dguZusnnTg00mpLw_FUBtFAQnzkfdWeKlkkrtwLN8CDky3dVmI=?__gda__=1490690799_f6cb8f4624b3225becd4e948b32c036c" -c:a aac -b:a 128k "output.m4a"
var ffmpeg = require('fluent-ffmpeg');
var command = ffmpeg()
.input('https://fs-preview.kfs.io/201307/0dguZusnnTg00mpLw_FUBtFAQnzkfdWeKlkkrtwLN8CDky3dVmI=?__gda__=1490690799_f6cb8f4624b3225becd4e948b32c036c')
.output('test.m4a')
.audioCodec('aac')
.audioBitrate('128k')
.on('start', cmd => console.log('Start with ' + cmd))
.on('progress', progress => console.log('Processing - ' + JSON.stringify(progress)))
.on('error', err => console.error(err))
.on('end', stdout => console.log('FFmpeg finished - ' + stdout));
command.run();
wav to mp3
ffmpeg -i inputfile.wav -ab 320k outputfile.mp3 ffmpeg -i audio.wav -acodec libmp3lame audio.mp3
ogg to mp3
ffmpeg -i audio.ogg -acodec libmp3lame audio.mp3
ac3 to mp3
ffmpeg -i audio.ac3 -acodec libmp3lame audio.mp3
aac to mp3
ffmpeg -i audio.aac -acodec libmp3lame audio.mp3
Take a look at the -t and -ss arguments. They should do what you want.
-t duration
Restrict the transcoded/captured video sequence to the duration specified in seconds. hh:mm:ss[.xxx] syntax is also supported.
-ss position'
Seek to given time position in seconds. hh:mm:ss[.xxx] syntax is also supported.
ffmpeg -ss 30 -t 70 -i inputfile.mp3 -acodec copy outputfile.mp3
Here's a command line that will slice to 30 seconds without transcoding:
ffmpeg -t 30 -i inputfile.mp3 -acodec copy outputfile.mp3
https://stackoverflow.com/questions/1390731/how-to-crop-a-mp3-from-x-to-xn-using-ffmpeg https://stackoverflow.com/questions/43890/crop-mp3-to-first-30-seconds
// Install FFMPEG + MP4 Codec in OSX
brew install ffmpeg --with-fdk-aac --with-ffplay --with-freetype --with-libass --with-libquvi --with-libvorbis --with-libvpx --with-opus --with-x265
// List all of codec
ffmpeg -codecs
// List all of format supported
ffmpeg -formats
// Save stream into h264
ffmpeg -i "http://219.70.20.195:81/videostream.cgi?user=admin&pwd=" -vcodec h264 -q 1 -framerate 12 output.mp4
// Save stream into flv
ffmpeg -i "http://219.70.20.195:81/videostream.cgi?user=admin&pwd=" -vcodec flv -q 1 -framerate 12 output.flv
Mute right audio channel
ffmpeg -i source.mov -map_channel -1 -map_channel 0.0.0 -c:v copy dest.mov
Mute left audio channel
ffmpeg -i source.mov -map_channel -1 -map_channel 0.0.1 -c:v copy dest.mov
Install FFmpeg on Ubuntu 14.04
Combine image and audio file into video file
原版指令(來源)
原版精簡
最精簡的版本,但會有一定機率失敗的問題