## Topic: how to compare two huge music directories regarding playback length, file count (Read 570 times)previous topic - next topic

0 Members and 1 Guest are viewing this topic.
how to compare two huge music directories regarding playback length, file count
##### 19 June, 2017, 07:37:50 AM
Hi I am Rupesh from India and I have a huge directory of size 150 gb of which 93 gb are mp3 files which are speeches recorded by someone at 64 kbps and remaining are music files with bitrate between 96 kbps to 216 kbps.

I want to compress all these files and store these in external memory card. Upon performing a number of experiments I came to conclusion that opus codec is best for speeches and mp4 files generated using aac(Nero acc encoder) is best for music with crystal clear quality at even lower bitrates.

I have converted 93 gb speech files to opus files and occupied 30 gb and converted remaining music files to mp4 files which occupied 20 gb. I have choosed lamexp for conversion which is a best open source software which combines binaries of other encoders including lame, opusenc, NeroAacEnc etc.,. For opus encoding I have used 11 kbps,16 kbps and 24 kbps. For aac encoding I have used 48 kbps and 56 kbps. For all encoding I have used 48000 Hz sample rate.

Even though I have used lower bitrates for conversion the resulted output files are of acceptable quality. The output file names generated and directory structure are identical to source.

During conversion very few of the original files are ignored and so no output files generated for those. Some very few of files are not transcoded properly I mean suppose source file is of 50 minutes length it was transcoded to a file containing 5 minutes or 10 minutes in length but the source and destination file names are identical. I have noticed those differences by examining some source and destination directories.

Sometimes I think that a huge amount of files are not transcoded properly as illustrated above. I want to compare source and destination directories and obtain a list of files with paths which are not transcoded properly.

Suppose I have a directory of size 23 gb and 2400 files and I have transcoded to a destination directory of size 5 gb and 2200 files.
can anyone of you suggest how to the list of the missing 200 file's.

Suppose I have a directory of playback length 600 hours distributed into various files say 1000 files and I have transcoded these files and the resulting file count is 1000 of playback length say 500 hours.  Can anyone of you suggest how to obtain the list of files with paths which are different in playback length.

Atleast can you suggest how to obtain the playback length of the total directory which contains 150 files.

Regards,
Rupesh.

• lothario15
Re: how to compare two huge music directories regarding playback length, file count
##### Reply #1 – 19 June, 2017, 12:32:18 PM
The way I'd approach your problem would be to use a diff tool.

1. Get lists of directory contents
First, open a console/terminal and navigate to the parent folder of the music files.  Recursively list contents and write the output to a text file:
(Windows example)
Code: [Select]
cd /D E:\path\to\OriginalFilesdir /s /b > C:\Users\YourUserName\Desktop\FileList1.txt
(Bash)
Code: [Select]
ls -R  '/path/to/OriginalFiles' >> FileList1.txt

Now navigate to the parent folder of the transcoded files and repeat the same commands, only this time name the output file 'FileList2.txt'.

2. Edit list for comparison
Open 'FileList2.txt' and use Ctrl+H to perform a find/replace - find all instances of '.opus' (and '.m4a', etc.) and replace them with the file extension of their original files ('.mp3').

3. Compare lists
If you'd prefer using a free graphical tool, on Windows you can use the Notepad++ compare plug-in (http://sourceforge.net/projects/npp-compare/) or you can use the cross-platform Meld (http://meldmerge.org/).

Simply compare 'FileList1.txt' with 'FileList2.txt'; the software will highlight any differences between the two lists.

I hope this helps.

• lothario15
Re: how to compare two huge music directories regarding playback length, file count
##### Reply #2 – 19 June, 2017, 12:39:36 PM
And for the second part of your problem (disparity of file lengths), use a tagging program to compare duration.

On Windows, I remember MP3Tag having an export feature which produced a CSV file of desired tag fields.  On Linux, I use puddletag and Kid3 which both have a similar export feature.

You simply need to export common fields like track title and duration and output the contents to a text file.  You can then use the comparison software to highlight differences.

Re: how to compare two huge music directories regarding playback length, file count
##### Reply #3 – 19 June, 2017, 12:54:55 PM
And for the second part of your problem (disparity of file lengths), use a tagging program to compare duration.

On Windows, I remember MP3Tag having an export feature which produced a CSV file of desired tag fields.  On Linux, I use puddletag and Kid3 which both have a similar export feature.

You simply need to export common fields like track title and duration and output the contents to a text file.  You can then use the comparison software to highlight differences.

Does Mp3Tag works for opus files and m4a files.

Does mediainfo useful for this task.

• lothario15
Re: how to compare two huge music directories regarding playback length, file count
##### Reply #4 – 20 June, 2017, 06:11:49 PM
And for the second part of your problem (disparity of file lengths), use a tagging program to compare duration.

On Windows, I remember MP3Tag having an export feature which produced a CSV file of desired tag fields.  On Linux, I use puddletag and Kid3 which both have a similar export feature.

You simply need to export common fields like track title and duration and output the contents to a text file.  You can then use the comparison software to highlight differences.

Does Mp3Tag works for opus files and m4a files.

Does mediainfo useful for this task.

find . -type f -name \*.mp3 -exec mediainfo {} \; |& egrep "Complete|Duration" >> FileList_Duration.txt