| View previous topic :: View next topic |
| Author |
Message |
heiowge LXF regular

Joined: Wed Feb 27, 2008 8:21 pm Posts: 1795 Location: Cheshire, UK
|
Posted: Mon Dec 26, 2011 11:58 pm Post subject: ogg to mp3 |
|
|
My mp3 player doesn't see ogg files.
Is there an easy to use program that can bulk convert 100+ ogg files at a time to mp3?
ta _________________ AMD PHENOM II X6, 14 GB DDR3, 500 GB hd, 1GB nVidia card, running Linux Mint 14 KDE / Win 7. Damn thing keeps breaking.
eeepc 1015PX, 1.66 Ghz Intel atom processor, 2 GB DDR3, 320 GB hd running Mint 14 MATE. Running great. |
|
| Back to top |
|
 |
Rhakios Moderator

Joined: Thu Apr 07, 2005 12:18 am Posts: 7473 Location: Midlands, UK
|
Posted: Tue Dec 27, 2011 1:45 am Post subject: |
|
|
It's never a particularly good idea to re-encode compressed files, but if you must then SoundConverter (or SoundKonverter for KDE users) can do the job on a file or folder basis. How long it takes will depend on how fast your computer is.
Cue someone with a way to do it from the command line... _________________ Bye, Rhakios |
|
| Back to top |
|
 |
PCNetSpec LXF regular

Joined: Sun Feb 21, 2010 3:50 pm Posts: 623 Location: Cornwall UK
|
Posted: Tue Dec 27, 2011 5:26 am Post subject: |
|
|
| Code: | | cd /directory/containing/ogg/files |
then
| Code: | | for name in *.ogg; do ffmpeg -i "$name" "$(basename "$name" .ogg).mp3"; done |
ffmpeg defaults to a bitrate of 64k .. so if you want a higher bitrate (say 128k), make that:
| Code: | | for name in *.ogg; do ffmpeg -i "$name" -ab 128k "$(basename "$name" .ogg).mp3"; done |
_________________ WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum |
|
| Back to top |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8002 Location: Warrington, UK
|
Posted: Tue Dec 27, 2011 10:45 am Post subject: |
|
|
No need to use basename, shells can do the extension replacement themselves
| Code: | | "${name/.ogg/.mp3}" |
which also avoids the problem of the unbalanced, nested quoted, which really need to be escaped. You also have the probem of ffmpeg losing all the ID data. Sound[CK]onverter is probably the best option. _________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
PCNetSpec LXF regular

Joined: Sun Feb 21, 2010 3:50 pm Posts: 623 Location: Cornwall UK
|
Posted: Tue Dec 27, 2011 2:42 pm Post subject: |
|
|
Nice
How about:
| Code: | | for name in *.ogg; do ffmpeg -i "$name" -ab 128k -map_meta_data 0:0,s0 "${name/.ogg/.mp3}"; done; |
which seems to keep the metadata. _________________ WARNING: You are logged into reality as 'root'... logging in as 'insane' is the only safe option.
Linux in the UK
The Linux Community Forum |
|
| Back to top |
|
 |
nelz Moderator

Joined: Mon Apr 04, 2005 12:52 pm Posts: 8002 Location: Warrington, UK
|
Posted: Tue Dec 27, 2011 3:33 pm Post subject: |
|
|
That should do it, I hadn't see the map_metadata option before. _________________ Unix is user-friendly. It's just very selective about who it's friends are. |
|
| Back to top |
|
 |
Ram LXF regular

Joined: Thu Apr 07, 2005 10:44 pm Posts: 1550 Location: Guisborough
|
Posted: Wed Dec 28, 2011 11:40 am Post subject: |
|
|
Think this should be moved to the Tips section... _________________
Ubuntu LXDE 12.04 running on AMD Phenom II*4; ASUS Crosshair III Formula MB; 4 GB Ram.....
|
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|