Log in

View Full Version : Trimming 5.1 FLAC


bob3000000
7th March 2011, 21:16
I need to trim a few sections out of a FLAC audio file for an ordered chapter project. However I can't figure out a good way to do it. Right now I am using MeGUI's HD Stream Extractor to convert the 5.1 stream to FLAC. I have to make the audio into a MKA file. I then use MeGUI's audio with a cut XML to process it, but that seem to convert it to stereo. I can make the changes manually in Sony Sound Forge but that is way to time consuming.

Any ideas how to do this?

b66pak
7th March 2011, 21:51
try with shntool (http://www.etree.org/shnutils/shntool/)...
_

bob3000000
7th March 2011, 22:36
try with shntool (http://www.etree.org/shnutils/shntool/)...
_
I could be wrong since I only took a quick look at it, but shntool seems to need as much manual input as my current method, if not more.

All I really need is a program to take the extracted FLAC file and have it cut out at specified frames and put back together. If I have to calculate the timecodes myself, the current method is easier.

-TiLT-
8th March 2011, 02:57
FLAC isn't well supported for direct editing. There are tools that support cut & join of DD and DTS (and their extended derivates or PCM) like eac3to and delaycut.

Though eac3to works with timecodes and delaycut works with milliseconds, it is quite easy to calculate the values with an excel sheet.

The reason for those tools not to use framenumbers is, audio does not know the framerate to of a video it may correspond to.

If you are working in a 25fps environment, your framelength is 40ms, for 23,976 its 41,708375ms, etc. calculate 1000/framerate.

When cutting, keep in mind, most compressed audio formats have a "framelength", too. For DD its 32ms, so you wont be able to cut in the middle of an audio frame. This will most likely introduce small delays when joining and can add up to visible desync.

bob3000000
8th March 2011, 04:20
Yeah I know about the frame rate thing, it is included in the cut XML. It works just fine on a stereo FLAC file, but not 5.1. Right now I am calculating the time codes in excel, but the process is not efficient. I have to manually select two sections of audio in 50+ files and remove them.

MeGUI audio cutter lets me insert one file and it does everything in seconds. Any MeGUI users out there know why this doesn't work? Why with the FLAC setting set to "Keep Original Channels" that a 5.1 file becomes stereo?

Mug Funky
8th March 2011, 05:05
try reaper. it's free for noncommercial yada yada, has native FLAC support (arbitrary channel counts), and is IMHO better than protools (and faster).

when you're chopped, crossfaded, etc, just right-click the audio and hit "glue", and it'll render it down to a single file for you.

there's a small learning curve, but it's well worth it for anything audio.

roozhou
8th March 2011, 06:36
Flac is lossless, which means I lose nothing from decoding and re-encoding. The best way is to decode, cut the pcm and reencode.
And keep in mind that Flac uses variable framerate.

bob3000000
8th March 2011, 07:35
try reaper. it's free for noncommercial yada yada, has native FLAC support (arbitrary channel counts), and is IMHO better than protools (and faster) Do you have a link for that? The only one I can find is a 30 day demo.

Flac is lossless, which means I lose nothing from decoding and re-encoding. The best way is to decode, cut the pcm and reencode. I am not sure what you mean? Are you saying cut the stereo FLAC file then upmix? Or do mean cut the original, then encode to FLAC? As I have had no luck with either. The original file is TrueHD and I can't find a single program that will deal with it.

EDIT: Keep in mind that I am still new at this so you might have to explain step by step.

roozhou
8th March 2011, 08:56
I am not sure what you mean? Are you saying cut the stereo FLAC file then upmix? Or do mean cut the original, then encode to FLAC? As I have had no luck with either. The original file is TrueHD and I can't find a single program that will deal with it.


Plz first answer this question: What is your current audio file? FLAC or TrueHD? 2.0 or 5.1?

I think all of them can be correctly decoded by ffmpeg-based decoders (e.g. ffdshow).

bob3000000
8th March 2011, 09:27
The original audio from the transport stream is TrueHD 5.1. Using MeGUI I can extract it as is, or to FLAC 5.1. So it is either FLAC or THD 5.1 audio that I can work with. But in the end I need a FLAC 5.1 file.