LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-25-2020, 11:24 PM   #1
Drylandfish
LQ Newbie
 
Registered: Mar 2020
Posts: 3

Rep: Reputation: Disabled
Looking for program that can join many MP3's into a single file in a specific order


Hi,

Tried searching the forums first to see if this oddball question had ever been addressed. Had no luck -but maybe I'm just terrible at search terms?

Linux Mint user here. I'm looking for a program that will run under Mint that can consolidate around 100 mp3's into a single large mp3 in a specific order -like from a playlist.

Here is my issue:

I volunteer for a community radio station that is currently under lockdown during the pandemic. Normally, I'd queue up around a 100 audio files for a 5-hour broadcast. I normally use QMMP for this task, bringing my laptop to the studio. In this situation, programmers are being asked to remotely submit large, single Mp3's to broadcast. At home, I'd rather not re-record all the music tracks and have to DJ in real time. It would be much more expedient to record only my station breaks and insert them between music/ID's/announcment files.

Is there any program that will allow me to compile a playlist and bake them all into one file? I mean without having to rename 1000's of files for alphabetical order or something.

It's my understanding that there used to be some programs that would "wrap" mp3's like this for file-sharing. And that some would run under Linux. Any recommendations would be helpful.

Thank you!

John
 
Old 03-26-2020, 01:00 AM   #2
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Linux Mint, Devuan, OpenBSD
Posts: 4,576
Blog Entries: 3

Rep: Reputation: 2297Reputation: 2297Reputation: 2297Reputation: 2297Reputation: 2297Reputation: 2297Reputation: 2297Reputation: 2297Reputation: 2297Reputation: 2297Reputation: 2297
Ugh. MP3 has horrible sound quality. Be warned that you must set some specific, minimum sound quality requirements (sample rate, bit depth, compression level) and then also spot check the sample before you play a sample for others. Otherwise you can get burned badly by some M$ users that way, they make unusable files sounding worse than tin speakers through a garden hoses, you get the blame. Ogg is not great but worlds better.

You kind of addressed this but perhaps you have original files in a lossless format which you can use to produce a new MP3 or other format file? That can be scripted too.

If you really want to do that with MP3 instead of with a lossless format, you could try mp3wrap or even ffmpeg. Either might work.

Code:
stat --printf '%n\0' *.mp3 | shuf --zero-terminated | xargs --null mp3wrap one-big-file.mp3
or maybe

Code:
tfile=$(tempfile)
stat --format "file '%n'" *.mp3 | shuf > $tfile
ffmpeg -f concat -safe 0 -i $tfile -codec copy one-big-file.mp3
test -f $tfile && rm $tfile
I'm not sure how either affect the sound quality. It'll be the same as before or worse, probably the same. Either can work from a file.

Another question, now that the sound quality is gone through the very use of MP3, do you want to try to keep the metadata? If so, you may to write a script to extract it from each file and then read it in. Though, mp3wrap appears it might save the metadata somehow and it warns you with new metadata that you have a concatenated file. ffmpeg seems to just use the metadata from the first file only.
 
1 members found this post helpful.
Old 03-26-2020, 02:13 AM   #3
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,714
Blog Entries: 9

Rep: Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790
All your source mp3's are very unlikely to be all in the same format (bitrate etc.) therefore "concatenating" would actually require transcoding. At leat with ffmpeg. I'm not sure what sort of magic mp3wrap deploys; but that raises another question, that of your station also being able to play the file.

Personally, I think your station's requirement to submit 1 large MP3 file is utter BS.
A playlist (and of course the files it references) would be far superior in all cases I can think of.
 
2 members found this post helpful.
Old 03-26-2020, 06:09 PM   #4
Drylandfish
LQ Newbie
 
Registered: Mar 2020
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by ondoho View Post
All your source mp3's are very unlikely to be all in the same format (bitrate etc.) therefore "concatenating" would actually require transcoding. At leat with ffmpeg. I'm not sure what sort of magic mp3wrap deploys; but that raises another question, that of your station also being able to play the file.

Personally, I think your station's requirement to submit 1 large MP3 file is utter BS.
A playlist (and of course the files it references) would be far superior in all cases I can think of.
Through a stroke of luck, most of the MP3's I use have the same bitrate, etc. However, you point out something I'd been trying to get around initially. It would be loads easier to drop a folder of audio files and a playlist into dropbox for them.

If I could sell them on that idea, is there a way to modify a QMMP playlist (m3u) to first, play on Winamp (the station uses Windows and Winamp to queue files for airplay)? I have never tried playing QMMP playlists on Winamp so I am not sure if they are interchangeable. Second, is there some toggle that will allow a playlist I create to ignore pathnames and play audio files from the folder in which it resides? Or even let me globally change the pathname for the files in an entire playlist at once? If those two things were possible, it would certainly simplify everything!

Thanks so much to both of you for your valuable suggestions!
 
Old 03-27-2020, 04:38 AM   #5
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 13,714
Blog Entries: 9

Rep: Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790Reputation: 3790
I believe it's possible to use relative pathnames (i.e. not starting with /) in playlists.
Can't say anything about Windows though.
 
1 members found this post helpful.
Old 03-27-2020, 07:45 AM   #6
teckk
Senior Member
 
Registered: Oct 2004
Distribution: FreeBSD Arch
Posts: 2,712

Rep: Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683Reputation: 683
You can concatenate media files with different size/bitrate.
First turn them into a transport stream, concatenate the .ts files, put them back into container.

Code:
ffmpeg -i vid1.mp4 -c:a copy -c:v copy -bsf:v h264_mp4toannexb out1.ts
ffmpeg -i vid2.mp4 -c:a copy -c:v copy -bsf:v h264_mp4toannexb out2.ts

touch confile

cat confile
file 'out1.ts'
file 'out2.ts'

ffmpeg -f concat -i confile -c:a copy -c:v copy Out.ts

ffmpeg -i Out.ts -c:a copy -c:v copy Out.mp4
As far as 100, make a list and loop through them.
Code:
for i in {1..10}; do
    echo "$i"
    sleep 1
done
 
1 members found this post helpful.
  


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
Logi Sales Manager on Ncurses (invoice, invoicing, orders, order, sale order, sales order...)? Xeratul Linux - Software 0 03-25-2017 02:45 PM
[SOLVED] Combining a directory of mp3 files into one file in order. yknivag Linux - Software 2 08-19-2016 08:28 AM
wget, download specific links into specific file names Si14 Linux - Software 1 04-30-2013 01:42 AM
grep multiple words any order (AND, not OR) single line, from many files cedardoc Linux - Newbie 7 07-29-2010 10:23 AM
Can't join Windows 2000 domain using net ads join The Cat Linux - Networking 2 09-23-2008 11:41 AM

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

All times are GMT -5. The time now is 07:03 AM.

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