FFmpeg concat demuxer is changing bitrate

2

I am using the concat demuxer to concat some wav files.

ffmpeg -safe 0 concat -i files.txt -c copy output.wav

files.txt stores files as:

file 'C:\Users\folderpath\input1.wav'

file 'C:\Users\folderpath\input2.wav'

etc

How can I add a -b into this command to set the bitrate? Right now without it, the files are being sped up--input files are 256kbps and output is 705kbps. I've tried several -b and -ab at different parts of the command, and cannot get this to work.

Ashley Guinan

Posted 2017-12-28T17:42:46.533

Reputation: 21

What are the properties of the two files? ffprobe file. Bitrate for WAV files is a simple fixed function = bitdepth x sampling rate x no. of channels – Gyan – 2017-12-28T18:11:04.593

The input properties are:

Metadata: encoder : Lavf57.73.100

Duration: 00:00:01.15, bitrate: 256 kb/s

Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 16000 Hz, 1 channels, s16, 256 kb/s

Output properties are:

Metadata: encoder : Lavf58.2.103

Duration: 00:00:13.82, bitrate: 705 kb/s

Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 1 channels, s16, 705 kb/s
 – Ashley Guinan  – 2017-12-28T18:21:53.450

Input properties are same for both files? – Gyan – 2017-12-28T18:27:18.813

No, that was the problem. Thank you!

I had some files that were 256k that were actual sound, and was trying to fill with empty sound using ffmpeg -y -f lavfi -i aevalsrc=0:duration=2 silence.wav

the aevalsrc defaults to 44100 Hz, I fixed it by adding a sample rate: ffmpeg -y -f lavfi -i aevalsrc=0:duration=2:sample_rate=16000 -acodec pcm_s16le silence.wav – Ashley Guinan – 2017-12-28T18:46:23.833

Answers

0

Not all of my input files were 256k, some were 705k so the concat demuxer used the first file, which was 705k.

I fixed it by fixing my input files created by:

ffmpeg -f lavfi -i aevalsrc=0:duration=2:sample_rate=16000 silence.wav

The key was adding sample_rate to the aevalsrc file--this portion was added after Mulvya's help.

Ashley Guinan

Posted 2017-12-28T17:42:46.533

Reputation: 21

1the concat demuxer used the largest --> it will use the properties of the first input. – Gyan – 2017-12-28T18:49:50.243

Edited to change that. Thanks for the help and the correction on the answer. – Ashley Guinan – 2017-12-28T18:51:40.597