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
VBRFIX(1)							   User Commands							 VBRFIX(1)

NAME
vbrfix - fix erroneous VBR MP3 files SYNOPSIS
vbrfix -flag1 -flag2 -flagn in.mp3 out.mp3 DESCRIPTION
In an average song there are points that require high quality and points that require low quality (i.e., silence). Instead of having the whole file at 160kbps (CBR - Constant Bit Rate), we can use VBR - Variable Bit rate. This allows us to have say 96Kbps at points not requiring high quality and 192kbps when we need it: resulting in an overall smaller but higher quality MP3. However, the problem is that many MP3 programs estimate the time of a MP3 based on the first bitrate they find and the filesize. With VBR you can get fairly random times; as most songs start with silence you usually get the song length being shown as much longer than it should be. Also when you jump through the file in VBR: 50% through the file is not 50% through the song. A VBR null frame is placed at the beginning of the file to tell the MP3 player information about the song length and indexing through the song. Some poor encoders don't produce this null frame or do so incorrectly - this is what vbrfix attempts to fix. Vbrfix can also fix other problems with MP3s as it deletes all non-MP3 content (other than tags you state you want to keep). It can also help when merging two VBR MP3s together with a merging tool and then needing a newly calculated VBR null frame. -ri1 removeId3v1 Tag -ri2 removeId3v2 Tag -skiplame if a tag was made by LAME don't fix it -always always write a new file even if not VBR -makevbr make it VBR (you need -always also) -log write a log file -lameinfo keep the lame info SEE ALSO
lame (1) VBRFIX Command Line Version May 2010 VBRFIX(1)
All times are GMT -4. The time now is 10:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy