LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-27-2020, 01:25 AM   #1
quickquestion111
LQ Newbie
 
Registered: Apr 2020
Posts: 12

Rep: Reputation: Disabled
How to set audio bitrate in ffmpeg?


Im modding a game (command and conquer 1) to add some music to it, and in their mod wiki they say you need to convert your audio files to 16-bit 22050 Hz WAV with a program of your choice. So im trying to do this with ffmpeg, but not sure if im doing it right. The command I used is as follows:

Code:
ffmpeg -i rick-roll.mp3 -b:a 16 -ar 22050 rickroll.wav
Does that look right to you? Cause when I check the audio properties (via a simple file manager) the Hz value (aka sample rate) is correct, but the bitrate says 705kbps (and not 16 bits)...

Last edited by quickquestion111; 05-27-2020 at 01:57 AM.
 
Old 05-27-2020, 02:01 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
probably: https://superuser.com/questions/6753...for-vbr/675647
 
Old 05-27-2020, 02:00 PM   #3
quickquestion111
LQ Newbie
 
Registered: Apr 2020
Posts: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by pan64 View Post
Thanks the command I put above works, so I guess the game does not strictly require a 16b bitrate.. But ffmpeg does give a warning saying "16b is extremely low and that you probably meant 16k", so it does that without giving me a choice. The game is from 1995 so I think the 16b recommendation from the game's wiki was accurate.. Do u know how to force ffmpeg to use the 16b? At this point it's just out of curiosity though, since it works reguardless.
 
Old 05-28-2020, 07:29 AM   #4
Madhu Desai
Member
 
Registered: Mar 2013
Distribution: Rocky, Fedora, Ubuntu
Posts: 541

Rep: Reputation: 153Reputation: 153
Code:
ffmpeg -i rick-roll.mp3 -c:a pcm_s16le -ar 22050 -f wav rickroll.wav
 
1 members found this post helpful.
Old 05-28-2020, 07:51 AM   #5
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,804

Rep: Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306Reputation: 7306
I'm not really sure, but I think 16b is not supported.
 
Old 05-28-2020, 01:23 PM   #6
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by quickquestion111 View Post
Im modding a game (command and conquer 1) to add some music to it, and in their mod wiki they say you need to convert your audio files to 16-bit 22050 Hz WAV with a program of your choice. So im trying to do this with ffmpeg, but not sure if im doing it right. The command I used is as follows:

Code:
ffmpeg -i rick-roll.mp3 -b:a 16 -ar 22050 rickroll.wav
Does that look right to you? Cause when I check the audio properties (via a simple file manager) the Hz value (aka sample rate) is correct, but the bitrate says 705kbps (and not 16 bits)...
ffmpeg's -b option refers to bits per second; your game's need to have 16-bit WAV is of a different kind.
ffmpeg is right to tell you that 16 bit per second is way too low to get any sort of usable audio from it. Did you listen to the result?

Actually, mddnix's answer appears to be the correct one.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ffmpeg twitch screencast no sound (correct bitrate) xcislav Linux - Desktop 4 10-24-2015 03:31 AM
[SOLVED] mencoder: how to keep audio bitrate setting at 192 kbps Ehtetur Linux - Software 2 11-25-2010 03:59 PM
mencoder ignores audio bitrate parameter Mistreated Linux - Software 4 01-10-2010 12:51 PM
ffmpeg bitrate problem J_angel2000 Linux - Software 2 05-14-2007 03:10 PM
48000Hz bitrate Audio distorted fabre Debian 5 12-09-2006 03:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration