Click here to Skip to main content
15,885,985 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Re-encoding - Is there such a thing? Pin
harold aptroot4-Aug-20 11:12
harold aptroot4-Aug-20 11:12 
GeneralRe: Re-encoding - Is there such a thing? Pin
dandy725-Aug-20 4:20
dandy725-Aug-20 4:20 
GeneralRe: Re-encoding - Is there such a thing? Pin
Sander Rossel4-Aug-20 12:00
professionalSander Rossel4-Aug-20 12:00 
GeneralRe: Re-encoding - Is there such a thing? Pin
Dar Brett4-Aug-20 22:24
Dar Brett4-Aug-20 22:24 
GeneralRe: Re-encoding - Is there such a thing? Pin
Sander Rossel5-Aug-20 2:37
professionalSander Rossel5-Aug-20 2:37 
GeneralRe: Re-encoding - Is there such a thing? Pin
dandy725-Aug-20 4:47
dandy725-Aug-20 4:47 
GeneralRe: Re-encoding - Is there such a thing? Pin
Davyd McColl4-Aug-20 21:18
Davyd McColl4-Aug-20 21:18 
GeneralRe: Re-encoding - Is there such a thing? Pin
Member 133016794-Aug-20 21:18
Member 133016794-Aug-20 21:18 
The easiest solution (I have actually done similar for bulk video processing) is to, for each file (named SONG.mp3 in my example below):

1. Convert to raw audio samples (the type you can cat to /dev/dsp, for example): SONG_ORG.pcm
2. Convert to 256kps, then convert that to raw audio samples: SONG_256KPS.pcm
3. Convert to 128kps, then convert that to raw audio samples: SONG_128KPS.pcm

At this point you'll have three uncompressed (raw audio) versions of the song. If you specified the same sampling rate for all of them they should all be the same size. Now this is the slightly more difficult part.

Write a program that takes two files and finds the statistics on the bytes in both files (avg, mean, median, variance, std-dev, frequency, distribution, etc) AND finds the statistics on the deltas between the two files taken together (some programs can do this).

Running this program on SONG_ORG.pcm and SONG_256KPS.pcm would show you how large the difference in sound is between the two files. If it is too large (experiment with the threshold) then you cannot re-encode to the smaller bitrate format because too much information was lost. If the difference is small then you can.

The only time-consuming part will be writing the program to examine PCM samples and give stats on the deltas. When I did this with video, I used ffmpeg to generate stills and image-magick to generate stats from those stills, and let it run over the weekend on all the videos I was checking. You can use sox/liblame to do the PCM/mp3 generation, but I don't know of a program that does for sound what image-magick does for images.
GeneralRe: Re-encoding - Is there such a thing? Pin
dandy725-Aug-20 4:28
dandy725-Aug-20 4:28 
GeneralRe: Re-encoding - Is there such a thing? Pin
Jason Hutchinson5-Aug-20 1:58
professionalJason Hutchinson5-Aug-20 1:58 
GeneralRe: Re-encoding - Is there such a thing? Pin
dandy725-Aug-20 4:34
dandy725-Aug-20 4:34 
GeneralRe: Re-encoding - Is there such a thing? Pin
mngerhold5-Aug-20 3:03
mngerhold5-Aug-20 3:03 
GeneralRe: Re-encoding - Is there such a thing? Pin
dandy725-Aug-20 4:40
dandy725-Aug-20 4:40 
GeneralRe: Re-encoding - Is there such a thing? Pin
mngerhold5-Aug-20 4:44
mngerhold5-Aug-20 4:44 
GeneralRe: Re-encoding - Is there such a thing? Pin
dandy725-Aug-20 4:54
dandy725-Aug-20 4:54 
GeneralRe: Re-encoding - Is there such a thing? Pin
kholsinger5-Aug-20 5:16
kholsinger5-Aug-20 5:16 
GeneralRe: Re-encoding - Is there such a thing? Pin
mngerhold5-Aug-20 5:44
mngerhold5-Aug-20 5:44 
GeneralRe: Re-encoding - Is there such a thing? Pin
kholsinger5-Aug-20 6:23
kholsinger5-Aug-20 6:23 
GeneralRe: Re-encoding - Is there such a thing? Pin
Furkan Omay5-Aug-20 19:22
Furkan Omay5-Aug-20 19:22 
GeneralRe: Re-encoding - Is there such a thing? Pin
dandy726-Aug-20 8:18
dandy726-Aug-20 8:18 
GeneralRe: Re-encoding - Is there such a thing? Pin
patbob11-Aug-20 7:56
patbob11-Aug-20 7:56 
GeneralRe: Re-encoding - Is there such a thing? Pin
dandy7211-Aug-20 8:13
dandy7211-Aug-20 8:13 
General2 major explosions in Beyrouth Pin
Maximilien4-Aug-20 8:50
Maximilien4-Aug-20 8:50 
GeneralRe: 2 major explosions in Beyrouth Pin
OriginalGriff4-Aug-20 9:02
mveOriginalGriff4-Aug-20 9:02 
GeneralRe: 2 major explosions in Beyrouth Pin
Daniel Pfeffer4-Aug-20 10:28
professionalDaniel Pfeffer4-Aug-20 10:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.