Skip to main content
Topic: Is it possible to change the sample rate without transcoding the files? (Read 337 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is it possible to change the sample rate without transcoding the files?

We have a massive batch of videos arrive today and they were encoded with 96 kHz AAC audio streams. We need them set to 48 kHz or lower for them to playback properly.

The videos themselves are perfectly fine (our clients are finally starting to listen in this regard!) but it seems someone decided bigger is better and went with a sample rate that we can not use.


Is there anyway for us to change the sample rate without transcoding all of the audio streams?


We can do it, but it will be a pain that we would love to avoid.

Update: woot! only SOME of the videos need their sample rate lowered! We checked the rest of them out and they are generally all 48kHz or lower! I can leave work on time! The ones that need their rates reduced are still significant but a minority of what we were given today.

Re: Is it possible to change the sample rate without transcoding the files?

Reply #1
You'll need to convert the audio track to WAV, resample that, then encode to AAC again, and then finally replace the old audio track with the new one.

So your question really isn't about resampling, it's about how to replace the audio track of a video with another audio track.

Personally, I'd use ffmpeg in the command line for this. But I assume there's GUI software out there than can rip and replace audio tracks on video files.

Re: Is it possible to change the sample rate without transcoding the files?

Reply #2
I think ffmpeg can do this in one operation? But IIRC, one should ideally compile ffmpeg with libfdk_aac then?
And someone can probably write a script using ffprobe which will leave the already-48's untouched.

Is there any need to keep the original 96 stream?  If so, one could consider (but I have no idea about compatibility) to try to mux in both the old and the new stream.
“It sounded bad to me. Digital. They have digital. What is digital? And it’s very complicated, you have to be Albert Einstein to figure it out.”
- Donald Trump, May 2017

Re: Is it possible to change the sample rate without transcoding the files?

Reply #3
If you were doing this in Final Cut Pro the resample happens when the media is imported to the library.  Happens in the background, and ends up at whatever rate you set the project for.  Same thing for video of differing resolution.  I'd be surprised if Premier didn't do pretty much the same thing, but perhaps not, and I'm not an Avid guy, so....ffmpeg...as others said.   Regardless, once it's done be sure to verify sync, head, tail, and middle in a few dozen places.

Re: Is it possible to change the sample rate without transcoding the files?

Reply #4
You'll need to convert the audio track to WAV, resample that, then encode to AAC again, and then finally replace the old audio track with the new one.

Personally, I'd use ffmpeg in the command line for this. But I assume there's GUI software out there than can rip and replace audio tracks on video files.

Thanks for the tip! We would have run them through ffmpeg but setting it up was going to be the pain. We figured out there are only a few dozen videos (out of thousands) that need this done. They oddly had a high frequency of filenames starting with "0" and "a" so when we tested the first bunch it freaked us out.

Is there any need to keep the original 96 stream?  If so, one could consider (but I have no idea about compatibility) to try to mux in both the old and the new stream.

There is none. We have to make these all work on extremely old and low-end devices. There is also a file-size issue that comes along with dealing with such ancient platforms and terrible network infrastructure for some of our clients.

 
SimplePortal 1.0.0 RC1 © 2008-2018