LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-02-2018, 09:59 AM   #1
newbiesforever
Senior Member
 
Registered: Apr 2006
Distribution: MX (desktop: XFCE 4)
Posts: 2,101

Rep: Reputation: 77
what's a quick way to convert many audio files to an iPod format?


I need to convert some MP3s to one of the native iPod formats. I know perfectly well that iPod is supposed to read MP3, but the recipient claimed the files were the wrong format (mistakenly, if my information was correct). Rather than debating it, I chose to take the flash drive back and convert the MP3s on it to one of the more recognizably iPod formats. (I think for me to do a little more computer work is, honestly, potentially easier than trying to convince a busy professional her facts might be incorrect. It was a nurse, a unit manager in a care center with more pressing things to do.)

I know perfectly well how to convert one file from one audio format to another: open it in Audacity and export it in the new format. But I forgot to consider that there are 60-80 MP3s on this flash drive; this is going to take a while if I do the above. So (after some research) I opened Winff and tried to convert the entire batch with Ffmpeg; but it doesn't appear to have anything I recognize as a native iPod format. I see two "Ac3 DVD" formats, MP3, Mpeg4, OGG, WAV, and WMA.

What else can I use to convert all the files? Or can I download anything to add iPod formats to what ffmpeg offers? I could go back to Audacity and zap them one by one if I have to, but it would be nice to avoid it...

Last edited by newbiesforever; 03-02-2018 at 01:03 PM.
 
Old 03-02-2018, 10:17 AM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 6,945

Rep: Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400
SoundConverter might be worth looking into.
just changing the extension might work, I'd have to check that one myself. I just resample mine mp3 and flac down to a 128 mp3's. Using flac and lame.

I just did that test , re-sample from mp3 to m4a and it played on kplay, eine, amarok,



this is my elaborate script I use. of course you can pull out the lame command line and set it up to work on the cli too. depending on what and where you want to put your files and such.

it separates the one with and without meta tags so I can fix that too and can or cannot save the originals depending on how I mod it. Using process of elimination logic.
Code:
#!/bin/bash

working_dir=/home/userx/m4as
move_to=/home/userx/m4as
script_dir=/home/userx/scripts

no_tags=/media/data/music_no_tags
orginals=/media/data/orginal_music

while read FILE ; do 
    c=$FILE
    xpath=${c%/*} 
    xbase=${c##*/}
    xfext=${xbase##*.}
    xpref=${xbase%.*}
    path=${xpath}
    pref=${xpref}
    ext=${xfext}


# set file name and extension

    newFile="$pref"."m4a"

    #removes and replaces leaving the band directroy and its subdirectories
    #to put the resmaped music into
    NoTags=${path/$working_dir/$no_tags}
    keep_orginals=${path/$working_dir/$orginals}
    
    bitrate="$(exiftool -p '$AudioBitrate' "$FILE")"
    #strips kpbs
    bitrate=${bitrate% *}
    echo "$bitrate"
# set check bitrate values low / high
rate2l=128
rate2h=128
    artist="$(exiftool -p '$Artist' "$FILE")"
    album="$(exiftool -p '$Album' "$FILE")"
    title="$(exiftool -p '$Title' "$FILE")"
    genre="$(exiftool -p '$Genre' "$FILE")"
##############################################################
# Resampling with LAME 99.9.5  
# if MP3 is out of limits then re-sample it if not then send it through
# skip resampling saves time
###
# flac -cd "$f" | lame -b 320 - "${f%.*}".mp3
if [[ "${ext}" == 'flac' ]] ; then
{
        echo "got Dflack file  $ext"
        
        
        flac -cd "$FILE" | lame -V2 -b 128  -F --vbr-new -m j -q 2  - "$newFile"
         
        #rm -v "$FILE"
        
        mid3v2 -a "$artist"  "$script_dir"/"$newFile"
        mid3v2 -A "$album"  "$script_dir"/"$newFile"
        mid3v2 -t "$title"  "$script_dir"/"$newFile"
        mid3v2 -g "$genre" "$script_dir"/"$newFile"
        
        if [[ -n "$artist" && -n "$album" ]] ; then
        {
            NewPath2="$move_to"/"$artist"/"$album"
            mkdir -p "$NewPath2"
            
            mv -vf "$script_dir"/"$newFile" "$NewPath2"
            
        #    echo;echo "moving orginal"
       #     mkdir -pv "$keep_orginals"
         #   rm -vf "$FILE"
          #  echo;echo "orginal moved"
        }
        else
        {
            mkdir -p "$NoTags"
            mv -vf "$script_dir"/"$newFile" "$NoTags"
            
                
       #     echo;echo "moving orginal"
           # mkdir -pv "$keep_orginals"
         #   rm -vf "$FILE"  
           # echo;echo "orginal moved"
        }
        fi
} # if  start bitrate  <    128     or   start bitrate > 160 then resample
elif [[ "${bitrate%.*}" -gt "${rate2h}" ]] ; then
{
    lame -V2 -b 128  -F --vbr-new -m j -q 2 "$FILE" "$newFile"
    mid3v2 -a "$artist"  "$script_dir"/"$newFile"
    mid3v2 -A "$album"  "$script_dir"/"$newFile"
    mid3v2 -t "$title"  "$script_dir"/"$newFile"
    mid3v2 -g "$genre" "$script_dir"/"$newFile"
    
    if [[ -n "$artist" && -n "$album" ]] ; then
    {
        NewPath2="$move_to"/"$artist"/"$album"
        mkdir -p "$NewPath2"
        mv -vf "$script_dir"/"$newFile" "$NewPath2"
                        
      #  echo;echo "moving orginal"
      #  mkdir -pv "$keep_orginals"
    #    rm -vf "$FILE"  
      #  echo;echo "orginal moved"
    }
    else
    {
        mkdir -p "$NoTags"
        mv -vf "$script_dir"/"$newFile" "$NoTags"
            
      #  echo;echo "moving orginal"
     #   mkdir -pv "$keep_orginals"
     #   rm -vf "$FILE"  
     #   echo;echo "orginal moved"
    }
    fi
}
elif [[  -n "$artist" && -n "$album" ]] ; then
{
            NewPath2="$move_to"/"$artist"/"$album"
            echo "$NewPath2 =>"
            mkdir -p "$NewPath2"
            cp -vf "$FILE" "$NewPath2"
}
else
{
    mkdir -p "$NoTags"
    mv -vf "$script_dir"/"$newFile" "$NoTags"
    
    echo;echo "moving orginal"
  #  mkdir -pv "$keep_orginals"
 #   rm -vf "$FILE"  
  #  echo;echo "orginal moved"
}
fi  
#done <<<"$(find "$working_dir"  "$working_dir2"  -type f -name "*.mp3" -o -name "*.Mp3" -o -name "*.MP3" -o -name "*.flac" )"
done <<<"$(find "$working_dir" -not \( -path /media/data/downloads -prune \) -type f -name "*.mp3" -o -name "*.Mp3" -o -name "*.MP3" -o -name "*.flac" )"

Last edited by BW-userx; 03-02-2018 at 10:36 AM.
 
1 members found this post helpful.
Old 03-02-2018, 11:36 AM   #3
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,297
Blog Entries: 36

Rep: Reputation: Disabled
"Apple recommends using the following file formats for iPod and iTunes content:
• AAC (Advanced Audio Coding) for audio content
AAC is a state-of-the-art, open (not proprietary) format. It is the audio format of choice for Internet, wireless, and digital broadcast arenas. AAC provides audio encoding that compresses much more efficiently than older formats, yet delivers quality rivaling that of uncompressed CD audio.
[1]

Last edited by Habitual; 03-02-2018 at 11:37 AM. Reason: cuz I care
 
1 members found this post helpful.
Old 03-02-2018, 12:41 PM   #4
newbiesforever
Senior Member
 
Registered: Apr 2006
Distribution: MX (desktop: XFCE 4)
Posts: 2,101

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by Habitual View Post
"Apple recommends using the following file formats for iPod and iTunes content:
• AAC (Advanced Audio Coding) for audio content
AAC is a state-of-the-art, open (not proprietary) format. It is the audio format of choice for Internet, wireless, and digital broadcast arenas. AAC provides audio encoding that compresses much more efficiently than older formats, yet delivers quality rivaling that of uncompressed CD audio.
[1]
Audacity has it available, but only to convert one file at a time.
Attached Thumbnails
Click image for larger version

Name:	m4A.png
Views:	2
Size:	9.7 KB
ID:	27112  

Last edited by newbiesforever; 03-02-2018 at 12:44 PM.
 
Old 03-02-2018, 12:58 PM   #5
newbiesforever
Senior Member
 
Registered: Apr 2006
Distribution: MX (desktop: XFCE 4)
Posts: 2,101

Original Poster
Rep: Reputation: 77
I think I unexpectedly found the answer. I saw that the website www.cloudconvert.com can convert MP4 to m4a. I thought the MPEG4 Audio that WinFF could convert to would be MP4, so I had Winff started converting all these MP3s to Mpeg4, and I see I was wrong. They're all converting from MP3 to M4A, not MP4. That was not obvious.

But as indicated in that screenshot, Audacity says M4A is AAC. I wish Winff would have made that clear. So I guess this should work. I don't own an iPod myself to observe the results with; but if iPod is known to read AAC/M4A, well then...

Last edited by newbiesforever; 03-02-2018 at 01:01 PM.
 
Old 03-02-2018, 01:02 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 6,945

Rep: Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400
FFMpeg Encode AAC

that gives some examples on how to mp3 to acc
Code:
 ffmpeg [OPTIONS] "$f" "${f%.mp3}.aac"
I do not have libfdk_aac so ... i cannot test results. I think I'm going to rebuild mine.

the bold part removes the mp3 and adds the other extension to the end of the file name

Last edited by BW-userx; 03-02-2018 at 01:44 PM.
 
1 members found this post helpful.
Old 03-02-2018, 01:05 PM   #7
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,311

Rep: Reputation: Disabled
Don't confuse codec with container. MP4 and MPA both are containers. AAC and MP3 are codecs.
 
2 members found this post helpful.
Old 03-02-2018, 01:07 PM   #8
newbiesforever
Senior Member
 
Registered: Apr 2006
Distribution: MX (desktop: XFCE 4)
Posts: 2,101

Original Poster
Rep: Reputation: 77
Quote:
Originally Posted by BW-userx View Post
FFMpeg Encode AAC

that gives some examples on how to mp3 to acc
Code:
 ffmpeg [OPTIONS] "$f" "${f%.mp3}.aac"
Yeah, that was probably what the Winff frontend just did for me.
 
Old 03-02-2018, 01:53 PM   #9
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: MID-SOUTH USA
Distribution: Slackware 14.2 / Slackware 14.2 current / Manjaro / Parrot
Posts: 6,945

Rep: Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400Reputation: 1400
Quote:
Originally Posted by newbiesforever View Post
Yeah, that was probably what the Winff frontend just did for me.
K , K so you got it under control now, yes?
 
1 members found this post helpful.
Old 03-02-2018, 03:56 PM   #10
newbiesforever
Senior Member
 
Registered: Apr 2006
Distribution: MX (desktop: XFCE 4)
Posts: 2,101

Original Poster
Rep: Reputation: 77
Yes, thank you.
 
Old 03-02-2018, 05:47 PM   #11
peteryellow
LQ Newbie
 
Registered: Mar 2018
Posts: 2

Rep: Reputation: Disabled
My advise is to use Gnormalize i have used it for many months and it worked great file ziper
 
1 members found this post helpful.
Old 03-03-2018, 05:33 PM   #12
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,297
Blog Entries: 36

Rep: Reputation: Disabled
Quote:
Originally Posted by Emerson View Post
Don't confuse codec with container. MP4 and MPA both are containers. AAC and MP3 are codecs.
I'm guilty.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux program to convert rm (real player) audio files to mp3 format des-traction Linux - Software 2 03-31-2009 07:04 PM
Convert video to iPod format leupi Linux - Software 17 01-08-2009 08:28 AM
How to convert multiple format videos to *.mp4 files which can be played on my iPod kcynice Slackware 13 10-21-2008 07:00 AM
How to convert rm format music files to mp3 format me4linux Linux - Software 2 05-15-2007 01:45 PM
How to convert flv to ipod format? depam Linux - Software 1 10-25-2006 08:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:35 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration