So, I have this program that is a game creator and it uses OGG and M4A files. OGG files are used on PC and M4A are used for Mobile exports. The thing is that there's looping information stored in the extended tags of the OGG and M4A files in exactly the same way. (using different tag codecs, but the loops work the same for both file formats

What I was wondering is if there's a way to batch convert every OGG file in a directory into an M4A file using the same name but a different extension, and retaining the tags of the original file, so I have both the OGG and M4A versions of the file.

I'm using Ubuntu 16.04

  • I have added an answer but I am not 100% sure about the transfer of the tags you mention, test it out and let me know... – andrew.46 Jul 4 '16 at 9:37

This can be done with the Xenial Xerus FFmpeg with 2 possible issues:

  1. Without modification the Xenial FFmpeg does not have access to the very best aac encoder (libfdk_aac)
  2. You will have to test to see if your particular tags are copied across, I cannot find such tags in the wild to test myself. FFmpeg by default will copy all tags...

First download FFmpeg:

sudo apt-get install ffmpeg libavcodec-extra

Change to a directory of your ogg files and run the following:

mkdir aac && \
for j in *.ogg
ffmpeg -i "$j" -vn -c:a aac -b:a 160k -strict -2 aac/"${j%.ogg}.m4a" 

This will create a sub-directory called aac and copy the new files there...


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.