LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 07-12-2011, 02:36 AM   #1
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora 3.6.11-1.fc17.i686.PAE
Posts: 501
Blog Entries: 12

Rep: Reputation: Disabled
Question converting videos to mp3 ?


i know that this a kiddish thing but i still find it a bit annoying that i can't really figure out the procedure.
I've mostly mp4/flv media files,i need to convert them to mp3 to put in my mp3 player but at the same time i like to adjust the mp3 bitrate to save space and maintain quality sometimes.
How do i actually do that in Linux.
Is there any GUI program that performs the job for me quickly ?
 
Old 07-12-2011, 02:52 AM   #2
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,718

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
I'm prettys sure that soundkonverter (Qt) or soundconverter (GTK) will do it. Not a great way though, IIRC both programs will convert the video stream to audio, then run that through a ripper. Since the audio on those files types is already compressed into a lossy format, any extra conversions will reduce the sound quality.

A better way is to check the .flv or .mp4 file and see what audio codec is inside. If its MP3, just strip the video, leaving you with an unconverted original .mp3 file. The only way I know to strip the video is with the command line though.

If its .aac (or similar)...honestly, in most cases it would be easy to find the file in .mp3 format, and its going to sound better than a lossy->lossy conversion.
 
1 members found this post helpful.
Old 07-12-2011, 03:19 AM   #3
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Here's what I would do:

Code:
ffmpeg -i 'The IT Crowd - Series 3 - Episode 4 The Internet.mp4' -acodec libmp3lame -ab 160k -ar 44100 -ac 2 out.mp3
 
1 members found this post helpful.
Old 07-12-2011, 03:24 AM   #4
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora 3.6.11-1.fc17.i686.PAE
Posts: 501
Blog Entries: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cascade9 View Post
A better way is to check the .flv or .mp4 file and see what audio codec is inside. If its MP3, just strip the video, leaving you with an unconverted original .mp3 file.

my mp4 videos have MPEG-4 AAC audio
 
Old 07-12-2011, 03:25 AM   #5
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora 3.6.11-1.fc17.i686.PAE
Posts: 501
Blog Entries: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by H_TeXMeX_H View Post
Here's what I would do:

Code:
ffmpeg -i 'The IT Crowd - Series 3 - Episode 4 The Internet.mp4' -acodec libmp3lame -ab 160k -ar 44100 -ac 2 out.mp3
i guess 160k is bitrate here ?
 
Old 07-12-2011, 03:27 AM   #6
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Yes, that is the bitrate. It is a good bitrate in that bitrates over this do not provide a huge improvement in quality, but do increase the size of the file.
 
Old 07-12-2011, 03:39 AM   #7
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora 3.6.11-1.fc17.i686.PAE
Posts: 501
Blog Entries: 12

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by cascade9 View Post
I'm prettys sure that soundkonverter (Qt) or soundconverter (GTK) will do it.
it seems that soundconverter has no option to configure output bitrate.
 
Old 07-12-2011, 03:53 AM   #8
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora 3.6.11-1.fc17.i686.PAE
Posts: 501
Blog Entries: 12

Original Poster
Rep: Reputation: Disabled
i was trying to understand the command provided and also read man page for the same.
this i what i got:
1) -ab is to set bitrate
2) -ac is to set output channels
3) -ar is to set frequency

please rectify me if i miss something !

But i' not getting what this is for :
1) -acodec
2) libmp3lame
 
Old 07-12-2011, 04:04 AM   #9
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,718

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by H_TeXMeX_H View Post
Yes, that is the bitrate. It is a good bitrate in that bitrates over this do not provide a huge improvement in quality, but do increase the size of the file.
I disagree with the 160K idea, IMO 160K MP3s are a little bit better than the sound of a goat pissing in a tin....

But thats besides the point. Most .flv videos are using 128k or less MP3 encoding. Transcoding a MP3 from a smaller bitrate to a bigger bitrate will not help sound quality at all. Transcoding them at all will hurt sound quality.

Theres a few ways to strip the video (or dump the audio) from .flv and .mp4/m4v here-

http://www.linuxquestions.org/questi...-video-508026/

Its a much, much better idea than transcoding lossy files.

Quote:
Originally Posted by dEnDrOn View Post
it seems that soundconverter has no option to configure output bitrate.
I thought it does? Maybe I was wrong, its been a while since I've used soundconverter, I'm more likely to use soundkonverter.

Quote:
Originally Posted by dEnDrOn View Post
my mp4 videos have MPEG-4 AAC audio
You can keep the .aac audio stripped from a video file if you want.

I prefer not to have .aac files on my HDD at all, and I cant think of any file I wanted in MP3 that I couldnt find in MP3 if I tried.

Last edited by cascade9; 07-12-2011 at 05:13 AM. Reason: typos
 
1 members found this post helpful.
Old 07-12-2011, 04:09 AM   #10
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora 3.6.11-1.fc17.i686.PAE
Posts: 501
Blog Entries: 12

Original Poster
Rep: Reputation: Disabled
i think i'd use FFmpeg,but for now i'm searching for answers to two of my questions...
one is this and other is:
How to convert multiple files using FFmpeg ?
 
Old 07-12-2011, 04:46 AM   #11
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Quote:
Originally Posted by dEnDrOn View Post
i was trying to understand the command provided and also read man page for the same.
this i what i got:
1) -ab is to set bitrate
2) -ac is to set output channels
3) -ar is to set frequency

please rectify me if i miss something !

But i' not getting what this is for :
1) -acodec
2) libmp3lame
-acodec means use the following audio codec. libmp3lame is the audio codec = mp3 via lame encoder.

Quote:
Originally Posted by dEnDrOn View Post
i think i'd use FFmpeg,but for now i'm searching for answers to two of my questions...
one is this and other is:
How to convert multiple files using FFmpeg ?
You can do this to convert multiple files:

Code:
for i in *.mp4; do ffmpeg -i "$i" -acodec libmp3lame -ab 160k -ar 44100 -ac 2 "$(basename "$i" .mp4).mp3"; done
basename is a command that cuts off extensions, and I use it to cut off .mp4 and replace it with .mp3.
 
1 members found this post helpful.
Old 07-12-2011, 04:53 AM   #12
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora 3.6.11-1.fc17.i686.PAE
Posts: 501
Blog Entries: 12

Original Poster
Rep: Reputation: Disabled
Talking

thanks cascade9 & H_TeXMeX_H......
i'm using FFmpeg now for conversions !!
 
Old 07-12-2011, 05:03 AM   #13
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Quote:
Originally Posted by cascade9 View Post
I disagree with the 160K idea, IMO 160K MP3s are a little bit better than the sound of a goat pissing in a tin....

But thats besides the point. Most .flv videos are using 128k or less MP3 encoding. Transcoding a MP3 from a smaller bitrate to a bigger bitrate will not help soudn quality at all. Transcoding them at all will hurt soudn quality.
We're talking about mp4 files here that come standard with 128k AAC audio. This transcodes well to 160k mp3.
 
Old 07-12-2011, 05:16 AM   #14
cascade9
Senior Member
 
Registered: Mar 2011
Location: Brisneyland
Distribution: Debian, aptosid
Posts: 3,718

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
Quote:
Originally Posted by H_TeXMeX_H View Post
We're talking about mp4 files here that come standard with 128k AAC audio. This transcodes well to 160k mp3.
Wow, I didnt even notice my typos till quoted. At least I was consistant with my use of 'soudn'. LOL

Sure, it will transcode...but you can transcode lossy-> lossless if you really want.

Just because it will transcode, doesnt mean it should be transocded. The output .mp3 will be worse sounding than the same sized MP3 ripped from a lossless or CD source, and also worse sounding than the original .acc file as well.

Last edited by cascade9; 07-12-2011 at 05:20 AM.
 
Old 07-12-2011, 05:26 AM   #15
dEnDrOn
Member
 
Registered: Jun 2011
Location: oMNipre$ent
Distribution: fedora 3.6.11-1.fc17.i686.PAE
Posts: 501
Blog Entries: 12

Original Poster
Rep: Reputation: Disabled
Question

can someone please tell how to normalize mp3 volume automatically ?
 
  


Reply

Tags
audio, convert, flv, mp3, mp4


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting videos for Android SlowCoder Linux - General 7 09-26-2013 05:17 AM
converting all kind of videos to flash ( FLV zafar466 Linux - General 1 07-25-2008 05:17 AM
Is there a program that will let me stream my videos to DVD without converting over? HGeneAnthony Linux - Software 6 04-21-2007 03:07 AM
converting to 3gp videos stevsom Linux - Software 1 02-27-2006 02:07 AM
converting to 3gp videos zba78 Linux - Software 1 08-12-2005 04:14 AM


All times are GMT -5. The time now is 01:41 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration