i'm trying to convert sound with ffmpeg using comand:
fmpeg -y -i /Users/Artem/Sites/waprik/testing/orig.mp4 -acodec libfaac -b:a 64k -ar 41000 -ac 2 -threads 0 -vn /Users/Artem/Sites/waprik/public/testing.m4a
original sound is 4:18 min, but output sound duration is 4 minutes and it sounds accelerated. How can i fix it ?
by the way, original sound is
Duration: 00:04:18.81
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 191 kb/s
Metadata:
creation_time : 2014-03-07 05:45:06
handler_name : IsoMedia File Produced by Google, 5-11-2011
you mistyped the audio rate. It should be 44100 instead of 41000:
ffmpeg -y -i /Users/Artem/Sites/waprik/testing/orig.mp4 -acodec libfaac -b:a 64k -ar 41000 -ac 2 -threads 0 -vn /Users/Artem/Sites/waprik/public/testing.m4a
Here's the math to prove it! Your initial track is 4 minutes 18 seconds, or 258 seconds. The ratio of your conversion rate to actual rate is 41000/44100, or .9297052. Multiply that ratio by your 258-second track and we end up with a 239.86-second track...or 3 minutes 59.86 seconds.
What was happening is that you were telling ffmpeg that instead of 44100 frames in a second, there were actually only 41000. So, it grabbed 41000 of the 44100 and called that a second, even though it really wasn't. The result is that you end up with a faster/shorter, slightly degraded audio file.
Related
I would like to convert a AC3 audio file (ATSC A/52 aka AC-3 aka Dolby Digital stream 6 channels) to Wave audio file (16khz mono/1 channel).
While searching on the internet, a lot of people just used ffmpeg -i file.ac3 file.wav however, i'm not sure if that even works.
I keep getting
[ac3 # 0x55ac1a0b0660] exponent -1 is out-of-rangets/s speed= 125x
[ac3 # 0x55ac1a0b0660] error decoding the audio block
[ac3 # 0x55ac1a0b0660] frame sync error
Error while decoding stream #0:0: Invalid data found when processing input
etc
while I do the same command.
How do I convert ac3 to wav (16khz mono)?
*Note:
I also tried ffmpeg -i file.ac3 -codec:a:1 ac3 -codec copy -b:a 384 file.wav -ac 1 -ar 16000. But this doesn't output an actual wav file.
ffmpeg -i file.ac3 -vcodec copy -acodec pcm_s16le -ar 16000 -ab 128k -ac 1 file.wav should do it!
Also you can convert Eac3 to wav in high quality mode.
The wav file will be 48KHz 24Bit 6 Channels.
ffmpeg -i "input.eac3" -acodec pcm_s24le -ar 48000 -ac 6 "output.wav"
If you want to export in 8 channels, just write 8 instead of 6.
i am trying to use multiple filters in ffpmeg, but it does not allow more than one -af.
so, then i decided to try to do it with a -complex_filter.
sudo ffmpeg -f alsa -i default:CARD=Device \
-filter_complex \
"lowpass=5000,highpass=200; \
volume=+5dB; \
afftdn=nr=0.01:nt=w;" \
-c:a libmp3lame -b:a 128k -ar 48000 -ac 1 -t 00:00:05 -y $recdir/audio_$(date '+%Y_%m_%d_%H_%M_%S').mp3
it must work, but for some reason i get an error:
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, alsa, from 'default:CARD=Device':
Duration: N/A, start: 1625496748.441207, bitrate: 1536 kb/s
Stream #0:0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
[AVFilterGraph # 0xaaab0a8b14e0] No such filter: ''
Error initializing complex filters.
Invalid argument
i have tried quotes and others, nothing helps..
ffmpeg -f alsa -i default:CARD=Device \
-filter_complex \
"lowpass=5000,highpass=200,volume=+5dB,afftdn=nr=0.01:nt=w" \
-c:a libmp3lame -b:a 128k -ar 48000 -ac 1 -t 00:00:05 -y $recdir/audio_$(date '+%Y_%m_%d_%H_%M_%S').mp3
If you end your filtergraph with ; then ffmpeg expects another filter. That is why you got the error No such filter: ''. Avoid ending with ;.
You have a linear series of simple filters so separate the filters with commas. This also means you can still use -af instead of -filter_complex if you prefer.
See FFmpeg Filtering Introduction to see the difference between ; and ,.
I have a flac audio file with incorrect duration in the metadata. The audio has a length of 55 minutes but the metadata has a duration of 0. Is it possible to use an ffmpeg command to fix this?
Below are the outputs of an ffprobe:
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
The FLAC header is missing or incomplete. Re-encoding will re-write it:
ffmpeg -i input.flac -c:v copy -c:a flac output.flac
There will be no quality loss as FLAC is lossless.
I have a video file with audio stream:
Stream #0:1(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s
And I can do mixdown it to two-channel audio:
ffmpeg -i vid.mkv -map 0:2 -acodec libmp3lame -y output.mp3
Update
It can be splitted by the channelsplit command, but it splits the Stream #0:1 by default and I can't specify Stream #0:2 channel.
./ffmpeg -i vid.mkv -vn -filter_complex 'channelsplit=channel_layout=5.1[FC]' -map '[FC]' front_center.mp3
How do I specify Stream #0:2 5.1 channel and get separated front center channel from this video?
So I have 2 files of the same video. One of the video files has two different audio streams
Stream #0:1(eng): Audio: flac, 48000 Hz, stereo, s16 (default)
Stream #0:2(jpn): Audio: flac, 48000 Hz, stereo, s16
I'm looking to map both of those streams and "paste" them on to the other identical file.
Just so it could look something like this when you would open in mpc-hc or something.
If you don't want to keep the existing audio in the uni-track video, then use
ffmpeg -i uni.mkv -i dual.mkv -c copy -map 0 -map -0:a -map 1:a swapped.mkv
(Remove -map -0:a if you do want to keep it)