Val Pan
Val Pan

Reputation: 29

FFmpeg change audio sample rate

I need to increase the sample rate by 10%. Sample rates of input files are unknown.

I found this. Example for 1 file:

ffmpeg -i xxx.mp3 -filter:a "asetrate=$(ffprobe -v error -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 xxx.mp3)*1.1" -y xxx1.mp3

But is is not working and creates 0kb file.

LOG:

[asetrate @ 00000000024242e0] [Eval @ 00000000005fde80] Undefined constant or missing '(' in 'ffprobe-verror-show_entriesstream=sample_rate-ofdefault=noprint_wrappers=1' [asetrate @ 00000000024242e0] Unable to parse option value "$(ffprobe -v error -show_entries stream=sample_rate -of default=noprint_wrappers=1" [Parsed_asetrate_0 @ 0000000000e6cb20] Option 'nokey' not found [AVFilterGraph @ 0000000002419ca0] Error initializing filter 'asetrate' with args '$(ffprobe -v error -show_entries stream=sample_rate -of default=noprint_wrappers=1:nokey=1 xxx.mp3)*1.1' Error reinitializing filters! Failed to inject frame into filter network: Option not found Error while processing the decoded data for stream #0:0 Conversion failed!

Upvotes: 0

Views: 3984

Answers (1)

user5900538
user5900538

Reputation:

You need to escape every ":" in your ffprobe command.

Upvotes: 1

Related Questions