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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
|
12-16-2006, 02:59 PM
|
#46
|
LQ Newbie
Registered: Dec 2006
Posts: 4
Rep:
|
were do i enter the code
|
|
|
12-16-2006, 03:00 PM
|
#47
|
LQ Newbie
Registered: Dec 2006
Posts: 4
Rep:
|
how can i change my mp4 into a mp3
|
|
|
12-16-2006, 03:01 PM
|
#48
|
LQ Newbie
Registered: Dec 2006
Posts: 4
Rep:
|
how can i change my mp4 song into a mp3 song
|
|
|
12-17-2006, 10:02 PM
|
#49
|
Member
Registered: Oct 2004
Location: Montreal, Canada
Distribution: Linux Mint 21.3 Cinnamon
Posts: 359
Rep:
|
Very good idea. I added it myself.
|
|
|
12-17-2006, 10:07 PM
|
#50
|
Member
Registered: Oct 2004
Location: Montreal, Canada
Distribution: Linux Mint 21.3 Cinnamon
Posts: 359
Rep:
|
Mr.Lliman1 you will need basic computer knowledge to use a simple script.
This thread is about a script to convert m4a files to mp3.
If you want to convert mp4 songs then the script is the same but I would change the content as followed:
#!/bin/bash
#
# mp4 to mp3 and tag transfer
# for music from iPod
# This software is licensed under the GNU General Public License
# For the full text of the GNU GPL, see:
#
# http://www.gnu.org/copyleft/gpl.html
#
# No guarantees of any kind are associated with use of this software.
#requirements: faad, lame
#Begin
clear
# variables
version=0.1a
current_directory=$( pwd )
for i in *.mp4
do
faad "$i"
x=`echo "$i"|sed -e 's/.mp4/.wav/'`
y=`echo "$i"|sed -e 's/.mp4/.mp3/'`
faad -i "$i" 2>.trackinfo.txt
sed -i '23s/unknown: /title: /' .trackinfo.txt
sed -i '24s/unknown: /artist: /' .trackinfo.txt
year=` grep '^unknown:[[:space:]]*[[:digit:]]*[[:space:]]*$' .trackinfo.txt|sed -e 's/unknown: //'`
sed -i 's/^unknown:[[:space:]]*[[:digit:]]*[[:space:]]*$/year: /' .trackinfo.txt
#If you get year problems use this instead
#year=`grep 'date: ' .trackinfo.txt|sed -e 's/date: //'`
sed -i 's/unknown: iTunes/iTunes: iTunes/' .trackinfo.txt
genrecount=`grep -c 'genre: ' .trackinfo.txt`
unknowncount=`grep -c 'unknown: ' .trackinfo.txt`
if [ "$genrecount" -eq 1 ] && [ "$unknowncount" -eq 2 ]; then
sed -i '25s/unknown: /composer: /' .trackinfo.txt
sed -i '26s/unknown: /album: /' .trackinfo.txt
genre=`grep 'genre: ' .trackinfo.txt|sed -e 's/genre: //'`
fi
if [ "$genrecount" -eq 1 ] && [ "$unknowncount" -eq 1 ]; then
sed -i '25s/unknown: /album: /' .trackinfo.txt
genre=`grep 'genre: ' .trackinfo.txt|sed -e 's/genre: //'`
fi
if [ "$genrecount" -eq 0 ] && [ "$unknowncount" -eq 3 ]; then
sed -i '25s/unknown: /composer: /' .trackinfo.txt
sed -i '26s/unknown: /album: /' .trackinfo.txt
sed -i '27s/unknown: /genre: /' .trackinfo.txt
genre='other'
fi
if [ "$genrecount" -eq 0 ] && [ "$unknowncount" -eq 2 ]; then
sed -i '25s/unknown: /album: /' .trackinfo.txt
sed -i '26s/unknown: /genre: /' .trackinfo.txt
genre='other'
fi
title=`grep 'title: ' .trackinfo.txt|sed -e 's/title: //'`
artist=`grep 'artist: ' .trackinfo.txt|sed -e 's/artist: //'`
album=`grep 'album: ' .trackinfo.txt|sed -e 's/album: //'`
track=`grep 'track: ' .trackinfo.txt|sed -e 's/track: //'`
lame --alt-preset 192 --id3v2-only --tt "$title" --ta "$artist" --tl "$album" --tg "$genre" --tn "$track" --ty "$year" "$x" "$y"
rm .trackinfo.txt
rm "$x"
mv "$y" "$artist - $title - $album.mp3"
rm "$i"
done
#If you get bad characters errors use this instead
#rm "$x"
#artist=`echo $artist | sed -e 's/\//_/'`
#mv "$y" "$artist - $title.mp3"
#rm $i
#done
|
|
|
12-29-2006, 05:29 PM
|
#51
|
LQ Newbie
Registered: Dec 2006
Posts: 1
Rep:
|
script to convert m4a, wma or ogg to mp3
This script will convert all files with the given extension to mp3 files:
usage tomp3.sh wma (converts all wma files to mp3)
This script needs mplayer, lame and transcode to work, so you will
need the appropriate packages.
Just put this in your executable path somewhere....
-------------------------------------------------------------
remove_spaces=1
tmp_file="/tmp/pcm_audio"
function rm_spaces() {
mv "$1" `echo $1 | tr ' ' '_'`
}
function tomp3() {
ext=$1
for i in *.$ext
do
if [ -f "$i" ]; then
dest=`basename "$i" .$ext`
if [ "$ext" = "ogg" ]; then
echo "Encoding $i to "$dest".mp3"
transcode -q 0 -i "$i" -o "$dest" -y null,lame 2>/dev/null
else
rm -f "$tmp_file"
mkfifo "$tmp_file"
#echo "Ripping $i"
mplayer -quiet -vo null -vc dummy -af volume=0,resample=44100:0:1 -ao pcm:waveheader:file="$tmp_file" "$i" &>/dev/null &
echo "Encoding $i to "$dest".mp3"
lame --quiet -m s -h -b 192 -V0 --vbr-new "$tmp_file" "$dest".mp3
# remove temp file
rm -f "$tmp_file"
fi
# remove spaces
if [ $remove_spaces -eq 1 ]
then
rm_spaces "$dest".mp3
fi
fi
done
echo "done."
}
case "$1" in
ogg)
tomp3 ogg
;;
wma)
tomp3 wma
;;
m4a)
tomp3 m4a
;;
*)
echo "Usage: tomp3.sh m4a|wma|ogg"
exit 1
esac
exit 0
|
|
|
01-24-2007, 01:39 PM
|
#52
|
LQ Newbie
Registered: Feb 2004
Location: Texas
Distribution: Arch Linux, Ubuntu
Posts: 5
Rep:
|
great script! you don't really need to move the files at the end. i just let the filename stay the same. if you do change it you need to make sure trakes < 10 have a 0 in front of it for sorting. has ANYBODY found a real configurable script for the written in perl or something of the like?
|
|
|
01-25-2007, 07:46 AM
|
#53
|
Member
Registered: Oct 2004
Location: bergen, norway
Distribution: OpenSuSe (SuSe 10.1), Win XP Pro
Posts: 539
Rep:
|
i haven't tried the script yet, but would like to do that soon. still, i'd prefer a program with interface. can anyone provide that!?
regards
ungua
|
|
|
02-19-2007, 11:14 AM
|
#54
|
Member
Registered: Feb 2003
Location: Florida
Distribution: Fedora Core 5 2.6.16-1.2133_FC5smp
Posts: 96
Rep:
|
If you haven't used one of the scripts yet, you should try the first one. There is no need for a GUI, all you have to do is fire up the script and let it crawl through your files, making them into mp3's.
I had to modify the script to get it to transcode my m4a's, but that was a 30 second find/replace with kwrite, otherwise is the exact same as was posted above.
http://mlinks.net/~scottm/m4a_to_mp3.sh
To use it:
0) Save the file above.
1) Place it in the same folder as the audio files you wish to transcode, or copy them into the folder containing the script.
2) From a terminal as normal user: chmod +x m4a_to_mp3.sh
3) Still in the terminal: ./m4a_to_mp3.sh
4) Sit back and watch, then enjoy your mp3's.
Note that this does replace the m4a files, so if you want to keep them as m4s'a as well, backup them up somewhere.
Hope this helps someone, the script was really handy to me!
Scott McNeely
Last edited by scm86; 02-19-2007 at 11:17 AM.
|
|
|
07-07-2007, 03:58 AM
|
#55
|
LQ Newbie
Registered: Jul 2007
Posts: 2
Rep:
|
SteelJ, thank you very much for all of the time that you spent on the script. I have used it for the basis for another script which handles recursively walking a directory and alternative directory names. If anyone is interested I have posted it:
(sorry I would have posted it here but it got very long)
|
|
|
07-07-2007, 03:58 AM
|
#56
|
LQ Newbie
Registered: Jul 2007
Posts: 2
Rep:
|
(Sorry about the double post, limitation of the site prevented me from posting the URL)
SteelJ, thank you very much for all of the time that you spent on the script. I have used it for the basis for another script which handles recursively walking a directory and alternative directory names. If anyone is interested I have posted it:
http://www.minigeek.org/index.php/20...ript/#more-116
(sorry I would have posted it here but it got very long)
Last edited by sblob; 07-07-2007 at 04:00 AM.
Reason: fixed URL
|
|
|
07-07-2007, 07:18 PM
|
#57
|
Member
Registered: Oct 2004
Location: Montreal, Canada
Distribution: Linux Mint 21.3 Cinnamon
Posts: 359
Rep:
|
Thanks man,
I dowloaded it and will use this one instead of the old one.
|
|
|
07-08-2007, 08:58 AM
|
#58
|
Moderator
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
|
Quote:
Originally Posted by sblob
(Sorry about the double post, limitation of the site prevented me from posting the URL)
|
Feature of the site. It is by design rather than by accident.
|
|
|
10-22-2007, 09:41 PM
|
#59
|
LQ Newbie
Registered: Oct 2007
Posts: 1
Rep:
|
I have used a similar tool called M4A to MP3 Converter whihc work on windows, but not on linux.
|
|
|
11-27-2007, 04:45 AM
|
#60
|
Member
Registered: Oct 2006
Location: Stirling in Scotland
Distribution: Slackware 13.37 64 bit
Posts: 297
Rep:
|
You could just install libmp4 and ecasound.If you want to convert to .mp3 just run in the folder containing the files ecaconvert .mp3 *.mp4.Simple.Change the .mp3 to .wav .flac .ogg depending on what output you need.
|
|
|
All times are GMT -5. The time now is 02:52 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|