Results 1 to 7 of 7

Thread: Converting m4a to ogg

  1. #1
    Join Date
    Jun 2007
    Location
    /MilkyWay/Sol/Earth/USA/
    Beans
    143
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Converting m4a to ogg

    I'd prefer a command line version if possible. Batch use would be best.
    Linux User #455951|Ubuntu User #17976|Some Useful information about your browser
    HTML Code:
    <html><head><title>Hello</title></head><body><p>Hello World</p></body></html>
    PHP Code:
    <?php echo "Hello World"?>

  2. #2
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: Converting m4a to ogg

    Converting one lossy audio format to another will just result in a lossier file.

    If you must, check out ffmpeg

    To enable the best performance see here

  3. #3
    Join Date
    Jul 2006
    Location
    Lancashire
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Converting m4a to ogg

    Hi

    ffmpeg will do the job.

    When I look in the 'presets' folder of WinFF he uses these settings:-
    Code:
    ffmpeg -i input.m4a -acodec vorbis -aq 60 -vn -ac 2 output.ogg
    But if you use this from the command line, or using the WinnFF gui, you'll lose any tags.

    Personally I would just use SoundConverter for a job like this. It would try and retain the tags.
    But if you want to use cli for your own reasons then that's fine. Develop a script to batch convert.
    Last edited by ron999; January 10th, 2010 at 01:36 AM.

  4. #4
    Join Date
    Jan 2008
    Location
    Manchester UK
    Beans
    13,573
    Distro
    Ubuntu

    Re: Converting m4a to ogg

    Quote Originally Posted by ron999 View Post
    Hi

    ffmpeg will do the job.

    When I look in the 'presets' folder of WinFF he uses these settings:-
    Code:
    ffmpeg -i input.m4a -acodec vorbis -aq 60 -vn -ac 2 output.ogg
    But if you use this from the command line, or using the WinnFF gui, you'll lose any tags.

    Personally I would just use SoundConverter for a job like this. It would try and retain the tags.
    But if you want to use cli for your own reasons then that's fine. Develop a script to batch convert.
    m4a will not work nice until you do what is outlined in the link I posted,

  5. #5
    Join Date
    Jun 2007
    Location
    /MilkyWay/Sol/Earth/USA/
    Beans
    143
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: Converting m4a to ogg

    This is the script I made. Seems to work well enough. Note that because it uses rename it is Debian derivative specific.
    Code:
    #!/bin/bash
    # m4a2ogg converts all m4a to ogg in a directory.
    # Arenlor
    for i in *.m4a
    do
            ffmpeg -y -i "$i" "$i".wav
            oggenc -q10 "$i".wav
    done
    rename 's/m4a.ogg/ogg/g' *
    rm *.wav
    rm *.m4a
    exit 0
    Linux User #455951|Ubuntu User #17976|Some Useful information about your browser
    HTML Code:
    <html><head><title>Hello</title></head><body><p>Hello World</p></body></html>
    PHP Code:
    <?php echo "Hello World"?>

  6. #6
    Join Date
    Dec 2006
    Beans
    7,349

    Re: Converting m4a to ogg

    Hi ron,

    Quote Originally Posted by ron999 View Post
    When I look in the 'presets' folder of WinFF he uses these settings:-
    Code:
    ffmpeg -i input.m4a -acodec vorbis -aq 60 -vn -ac 2 output.ogg
    But if you use this from the command line, or using the WinnFF gui, you'll lose any tags.
    Newer versions of FFmpeg have an option to preserve the meta tags:

    Code:
    andrew@skamandros~$ ffmpeg -h | grep 'map_meta_data'
    [...]
    -map_meta_data outfile:infile  set meta data information of outfile from infile
    This would make the commandline:

    Code:
    ffmpeg -i input.m4a \
    	-acodec vorbis -aq 60 -vn -ac 2 \
    	-map_meta_data outfile.ogg:input.m4a \
    	output.ogg
    I have to admit that I have not used this option extensively but it has worked flawlessly on the half a dozen time I have used it. Thus I am not completely sure how many media types it will work with...

    All the best,

    Andrew
    You think that's air you're breathing now?

  7. #7
    Join Date
    Jul 2006
    Location
    Lancashire
    Beans
    Hidden!
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Converting m4a to ogg

    Hi Andrew
    That's very interesting about ffmpeg's meta data.
    My version of ffmpeg has the option too.

    ron@ubuntu:~$ ffmpeg -h | grep 'map_meta_data'
    FFmpeg version SVN-r19352-4:0.5+svn20090706-2ubuntu2, Copyright (c) 2000-2009 Fabrice Bellard, et al.
    [...]
    -map_meta_data outfile:infile set meta data information of outfile from infile
    I tested it using this command:-

    Code:
    ffmpeg -i "03 - Flying.m4a" -acodec vorbis -aq 60 -vn -ac 2 -map_meta_data outfile.ogg:"03 - Flying.m4a" output.ogg
    Then I analysed the output file with MediaInfo:-

    General
    Complete name : /home/ron/Desktop/output.ogg
    Format : OGG
    File size : 3.06 MiB
    Duration : 2mn 15s
    Overall bit rate : 189 Kbps

    Audio
    ID : 0 (0x0)
    Format : Vorbis
    Duration : 2mn 15s
    Channel(s) : 2 channels
    Sampling rate : 44.1 KHz
    Resolution : 16 bits
    It doesn't seem to be working, there's no tag information there.

    When I converted the file using SoundConverter the tags seem intact:-

    General
    Complete name : /home/ron/Desktop/03 - Flying.ogg
    Format : OGG
    File size : 3.00 MiB
    Duration : 2mn 15s
    Overall bit rate : 186 Kbps
    Album : Magical Mystery Tour
    Track name : Flying
    Performer : The Beatles
    Genre : Rock/Classic Rock/Pop
    Copyright : © 2009 EMI Records Ltd
    Comment : Lavf52.31.0
    COMPOSER : The Beatles

    Audio
    ID : 1317219419 (0x4E832C5B)
    Format : Vorbis
    Format settings, Floor : 1
    Duration : 2mn 15s
    Bit rate mode : Constant
    Bit rate : 192 Kbps
    Channel(s) : 2 channels
    Sampling rate : 44.1 KHz
    Resolution : 16 bits
    Stream size : 3.10 MiB
    Writing library : libVorbis 1.2 (UTC 2007-06-22)
    So maybe ffmpeg's meta data option works for some types of files and not others, as you hinted.
    Last edited by ron999; January 10th, 2010 at 12:15 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •