Sponsored Content
Top Forums Shell Programming and Scripting Need a script for automation the convert a lot number audio files to another format Post 302957614 by temp-usr on Tuesday 13th of October 2015 07:57:44 AM
Old 10-13-2015
Hammer & Screwdriver Need a script for automation the convert a lot number audio files to another format

I have a lot number audio files in the MP3 proprietary format, I want to convert them to 'opus' the free and higher quality format, with keep metadata also.

My selection command-line programs are SoX (Sound eXchange) for convert MP3 files to 'AIFF' format in order to keep quality and metadata* and 'opusenc'[1] the official encoder for convert 'AIFF' files to 'opus' format. Most important part of the work is use of 'mediainfo' program for exporting metadata tags of MP3 files and giving them to 'opusenc' program for importing metadata tags to encoding opus files, also giving the bit-rate value of original MP3 files to 'opusenc' for encoding large size AIFF files in order to achieve the opus files with same bit-rate of original MP3 files, so I need a script for automation listed below operations:

1. Use sox for convert MP3 files in a directory with many sub-directory to the files with AIFF format with same name.

2. Use 'mediainfo' for exporting metadata tags (Album, Performer, Track name, Recorded date, Genre) and bit-rate value of original MP3 files.

3. Giving the previous step information to 'opusenc' (artist, title, album, date YYYY-MM-DD, genre)[1] and run it.

4. Delete MP3 and AIFF files after encode successfully done.

I want mentioned operations run consecutive on directories one by one.

My goal of this work is achieve to more freedom. Thank you very much for help and time that you devote to this work.

*: I choose AIFF format because it supports ID3v2 tags but when for test I convert a MP3 file contains metadata to 'AIFF' format with 'SoX' program and convert it to 'opus' with 'opusenc', result was the output opus file lacks metadata (don't known what is the problem exactly) also there was need to specify bit-rate value of MP3 file, so use of 'mediainfo' is necessary.

[1]: https://mf4.xiph.org/jenkins/view/opus/job/opus-tools/ws/man/opusenc.html
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Want To convert script in Linux format

I have scripts which I want to convert in Linux format. Note these scripts are in txt format.But I want to convert them in Linux, as DBA's will be using this script. Any command or utility which converts tht files in proper Linux format. Thanks in Adavce. Kunal (1 Reply)
Discussion started by: niceboykunal123
1 Replies

2. Shell Programming and Scripting

convert files into csv format using perl

Hi all perl gurus, I need your help to get the desired output in perl. I have a file which has text in it in the format Connection request start timestamp = 12/08/2008 00:58:36.956700 Connect request completion timestamp = 12/08/2008 00:58:36.959729 Application idle time ... (10 Replies)
Discussion started by: azs0309
10 Replies

3. Shell Programming and Scripting

Rename a lot of files using shells script

Hi This is the list file that i have : The files is more than this. I will rename one by one file become like this : So just change the time stamp 200906 become 200905. Is it possible using script ? Thanks (3 Replies)
Discussion started by: justbow
3 Replies

4. Shell Programming and Scripting

How to convert date format such as 7/18/2015 to the number of month

How to convert date format such as 7/18/2015 to the number of month from requesting date 'date' in sh scripting ? Let say I have output in my log.txt -> 7/18/2015. How I convert it to the full number of month starting from 'date' till 7/18/2015 in shell scripting ? Thanks in advance. (1 Reply)
Discussion started by: amerabest
1 Replies

5. Shell Programming and Scripting

Python script to convert date to iso format

Hi , This is my 1st program in python never tried any python before. i am trying to write a python script which reads a .tsv file line by line and in each line it should look for mm/dd/yyyy formate and convert it to yyyy-mm-dd formate . can some one provide be some sample code to do that. (2 Replies)
Discussion started by: vikatakavi
2 Replies

6. Shell Programming and Scripting

Sed/awk command to convert number occurances into date format and club a set of lines

Hi, I have been stuck in this requirement where my file contains the below format. 20150812170500846959990854-25383-8.0.0 "ABC Report" hp96880 "4952" 20150812170501846959990854-25383-8.0.0 End of run 20150812060132846959990854-20495-8.0.0 "XYZ Report" vg76452 "1006962188"... (6 Replies)
Discussion started by: Chinmaya Kabi
6 Replies

7. Shell Programming and Scripting

Convert a lot of files in subdirectories automatically

Hi, I have a huge structure of directories and subdirectories contsining some data. The lowest folders contain a file "image.png" which need to be converted to "folder.jpg". But how can I do that for all these files automatically? That's what I alredy have find /path -type f -name... (1 Reply)
Discussion started by: KarlKarpfen
1 Replies

8. Shell Programming and Scripting

Help need to convert bi-lingual files in sub-title format

I have a large number of files in the standard subtitle format with the additional proviso that the files are bi-lingual i.e. English and a second language: in this case Hindi. A small sample is given below: 00 04 07 08 00 04 11 00 I mean very high fever... He even vomited. 00 04 07 08 00... (6 Replies)
Discussion started by: gimley
6 Replies
DIR2OGG(1)						      General Commands Manual							DIR2OGG(1)

NAME
dir2ogg - Convert MP3, WAV, and M4A files to OGG format SYNOPSIS
dir2ogg [ options ] ( filename [filename2] ... || directory [directory2] ... || [cdrom-device] ... ) DESCRIPTION
dir2ogg converts MP3, M4A, WMA and WAV files to the open-source OGG format. dir2ogg is a python script that simply binds together mpg123, faad, and oggenc making it easier for the user to convert his/her music files. OGGs are about 15 to 20 percent smaller than MP3 files, with the same relative audio quality. dir2ogg can be called with the -d flag at the command line to convert any number of directories at once, or given MP3, M4A, WMA, and/or WAV filenames as arguments, dir2ogg will convert only those files. If converting WAV, M4A or WMA files with -d you must add the -w, -m or -W command line flags respectively. These flags are not neccesary unless using -d. Note that converting M4A files requires you to have faad installed, and converting WMA files requires mplayer. Keep in mind that converting from MP3 or M4A to OGG is a conversion between two lossy formats. This is fine if you just want to free up some disk space, but if you're a hard-core audiophile you may be disappointed. I really can't notice a difference in quality with 'naked' ears myself. General Options -h or --help print quick usage details to the screen. -d or --directory convert all MP3 files in directory. WAV and M4A files will be converted if used with the -w and -m command line flags. This option is for compatibility purposes only and does not need to be specified anymore. -r or --recursive like -d but descends recursively into directories. -c or --cdda Convert an audio CD into ogg. You may pass the device as an argument to the script (default: /dev/cdrom). Requires cdparanoia orq icedax or mplayer -p or --preserve-wav preserve all WAV files. By default they are deleted. -P or --no-pipe Do not use pipes to send data from the decoder to the encoder, use temporary wav files instead. --delete-input Delete the input file after conversion -v or --verbose increase dir2ogg's verbosity. -Q or --quiet Do not display progress messages, except the name of the file which is currently converted. Some decoders provide no way to disable messages and thus may still display some. Conversion options --convert-all Convert all supported audio files found in the directories given on the command-line to Ogg Vorbis. -f or --convert-ape Convert all APE (Monkey's Audio) files found in the directories given on the command-line to Ogg Vorbis, using either ogg123 or flac or mplayer. -f or --convert-flac Convert all FLAC (Free Lossless Audio Codec) files found in the directories given on the command-line to Ogg Vorbis, using ogg123 or flac or mplayer. -m or --convert-m4a convert all M4A (MPEG-4 Audio) files found in the directories given on the command-line to Ogg Vorbis, using faad or mplayer. For decoding ALAC (Apple Lossless) files, 'alac-decoder' may be used. -m or --convert-mpc convert all MPC (MusePack) files found in the directories given on the command-line to Ogg Vorbis, using mpcdec or mplayer. -W or --convert-wma Convert all WMA (Windows Media Audio) files found in the directories given on the command-line to Ogg Vorbis, using mplayer. -w or --convert-wav Convert all WAV files found in the directories given on the command-line to Ogg Vorbis. -V or --convert-wv Convert all WV (WavPack) files found in the directories given on the command-line to Ogg Vorbis. -n or --no-mp3 ingore all MP3 files found in directories given on the command-line. --(ape|cd|flac|m4a|mp3|mpc|wma|wv)-decoder=COMMAND Set the decoder you want to use for one filetype, e.g.: --mp3-decoder=lame. Run dir2ogg --help to see the available decoders. -qN or --quality=N OGG quality. N is a number between -1 and 10. Default is 3. Decimals are OK (ie: 3.7) -t or --smart-mp3 Try to use the same quality as the input file. MP3 input only! SEE ALSO
mpg123(1), mplayer(1), oggenc(1) BUGS
Enter you bug reports in Launchpad at https://bugs.launchpad.net/dir2ogg AUTHORS
0.10 and newer: Julian Andres Klode <jak@jak-linux.org> 0.9.3 and older: Darren Kirby <d@badcomputer.org> CONTRIBUTORS
original wma support: Cameron Stone <camerons@cse.unsw.edu.au> smart-mp3: Marek Palatinus <marek@palatinus.cz> dir2ogg 0.11.8 2009-08-04 DIR2OGG(1)
All times are GMT -4. The time now is 04:18 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy