If this is your first time here please read our FAQ and Rules pages. They have some useful information that will get us all off on the right foot. More details on our policies, especially our Own the Source rule are available here. If you do not understand any of these rules send a private message to one of our staff for further details.

Captain Khajiit's Basic Guide to Decoding Video and Audio
#11
4) Audio

There are three main types of audio that the faneditor might encounter:  linear PCM, Dolby Digital, and DTS.  There are various types of Dolby Digital and DTS, including HD audio.  Eac3to can decode them all; the guide also presents BeHappy as an alternative.  You should decode audio to mono WAVs for editing.  Vegas users might choose to decode to W64 instead.  Multi-channel linear PCM does not require decoding, but you might want to split it into mono WAVs.
The fault, dear Brutus, is not in our stars, but in ourselves.

Captain Khajiit's Basic Cross-platform Guide to Handling UHD
Captain Khajiit's Basic Guide to Decoding Video and Audio
Captain Khajiit's Quick Guide to Encoding a BD via the Command-line
Captain Khajiit's Basic Guide to Encoding with HCenc

For tech support, PM me (politely) or use the @+username function: I rarely read through threads these days.
Reply
#12
4a)  Decoding with eac3to

Eac3to decodes Dolby Digital and DTS formats (including TrueHD and DTS-HD MA) using free software, so if you are dealing with those formats on a BD or HD DVD, you can demux and decode your audio in one step; in fact, I strongly recommend that you do so.  If you are demuxing a TrueHD stream on a seamless-branching disc, you must decode your audio at this point, or you will experience sync problems.  In the picture below, the audio stream being decoded is DTS-HD MA, but the same principle applies to all audio tracks.

[Image: fomzvm.png]

Once you have selected WAVs or W64, continue the demuxing process that is outlined in section 2.

If you have demuxed a DVD with PGCDemux and want to use eac3to to decode an AC-3 file and split it into mono wavs, I suggest that you use the command line.  This command line gives you the pattern to follow.  You have to change it to fit your directory structure.

eac3to input.ac3 output.wavs

The first part is the location of eac3to on your hard drive.  (You will find the .exe inside your eac3to folder.)
The second part is the location of the source file on your hard drive.
The third part is where you want your output to be and what you want it to be called.

For example,

“"C:\eac3to\eac3to.exe" “C:\Wherever\whatever.ac3” “C:\Wherever\whatever.wavs”

You input this at the command prompt.  (If you do not how to find this,  click on the Start button in the  bottom left, and type Run into the  start box to bring it up.   Alternatively, on Vista and above, you can  copy and paste your command  line into the search box and hit enter and  it should work.)
The fault, dear Brutus, is not in our stars, but in ourselves.

Captain Khajiit's Basic Cross-platform Guide to Handling UHD
Captain Khajiit's Basic Guide to Decoding Video and Audio
Captain Khajiit's Quick Guide to Encoding a BD via the Command-line
Captain Khajiit's Basic Guide to Encoding with HCenc

For tech support, PM me (politely) or use the @+username function: I rarely read through threads these days.
Reply
#13
4b) Decoding with BeHappy

N.B. Originally, this section was here because eac3to could not, at the time, decode DTS-HD MA, so it was necessary to extract the core.  This is no longer true; however, BeHappy is still a useful program, so I have decided to leave the decoding instructions here (for now) to show how it works.

Install BeHappy and look in the installation directory.  You should see a folder labelled plugins.  Open it and copy the contents to your AvSiynth plugins directory.  Run the program.  

[Image: 16lkwur.png]

  1. In the top-left, you will see long white box labelled [1] Source.  Beneath it is a drop-down menu, the first item in which is the word AviSynth. Click the small, downward-facing arrow and select NicDTSSource.
  2. You will see two buttons with three dots in them […].  Click the one on top and select your DTS file.
  3. In the middle is a section labelled [3] Digital Signal Processing. Highlight Convert Sample To 8 Bit Int and hit Configure.  Select 16-bit int.  Make sure the box next to it is checked.
  4. Now look at the long white box at the bottom labelled [4] Destination and locate another drop-down menu beneath it.  Select “Wavsplit @ Mono wav's” (sic).
  5. Fill out your destination folder and output file-name.
  6. Hit Enqueue.
  7. Click on the Queue tab.  Then hit Start.
The fault, dear Brutus, is not in our stars, but in ourselves.

Captain Khajiit's Basic Cross-platform Guide to Handling UHD
Captain Khajiit's Basic Guide to Decoding Video and Audio
Captain Khajiit's Quick Guide to Encoding a BD via the Command-line
Captain Khajiit's Basic Guide to Encoding with HCenc

For tech support, PM me (politely) or use the @+username function: I rarely read through threads these days.
Reply
#14
5) FAQ

How do I convert to RGB?

Strictly speaking, this question concerns processing rather than decoding; nevertheless, instructions are given below.

If your source is SD, add this line to your script.

Code:
ConverttoRGB()

If your source is HD, add this line to your script.

Code:
ConverttoRGB(matrix="Rec709")

Both of the above expand the luma range i.e. convert to what Sony calls computer RGB.

You can then make a lossless AVI by doing the following.

Open the script in VirtualDub.

File→Open video file...
Video→Compression→Lagarith (or whatever)
Video→Fast Recompress
File→Save as AVI

N.B. After editing in RGB in an NLE, export a lossless AVI in the same color-space (RGB), and then convert back to YV12 in Rec601/Rec709-aware way.  In other words, for SD output, use ConvertToYV12(), and for HD output, use ConvertToYV12(matrix="Rec709").


Thanks

jagabo
KobaKommander
neuron2
poisondeathray
tebasuna51
TV's Frink
The fault, dear Brutus, is not in our stars, but in ourselves.

Captain Khajiit's Basic Cross-platform Guide to Handling UHD
Captain Khajiit's Basic Guide to Decoding Video and Audio
Captain Khajiit's Quick Guide to Encoding a BD via the Command-line
Captain Khajiit's Basic Guide to Encoding with HCenc

For tech support, PM me (politely) or use the @+username function: I rarely read through threads these days.
Reply
#15
Awesome thread. Stuck.
Reply
#16
[Image: e3xz.png]

When I decoded both audio streams, the wavs for the AC3 EX were larger than TrueHD/AC3 wavs. Did something go wrong? I would have expected the HD audio to be larger.
Reply
#17
I'm not sure, Frink. Are the smaller WAVs truncated? Is one set 16-bit and the other 24? Look at the log and see what it says.

EDIT: By the way, I might not be able to reply for a long while, as I'm on vacation and rarely have internet access. Moreover, I am not at my computer at the moment, so I don't have access to the program.
The fault, dear Brutus, is not in our stars, but in ourselves.

Captain Khajiit's Basic Cross-platform Guide to Handling UHD
Captain Khajiit's Basic Guide to Decoding Video and Audio
Captain Khajiit's Quick Guide to Encoding a BD via the Command-line
Captain Khajiit's Basic Guide to Encoding with HCenc

For tech support, PM me (politely) or use the @+username function: I rarely read through threads these days.
Reply
#18
Log:

Quote:eac3to v3.26
command line: "C:\Editing Tools\eac3to\eac3to.exe" "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\00000.m2ts" 3:"C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_3_audio.wavs" 4:"C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.wavs" -progressnumbers
------------------------------------------------------------------------------
M2TS, 1 video track, 2 audio tracks, 1:35:03, 24p /1.001
1: Chapters, 30 chapters
2: VC-1, 1080p24 /1.001 (16:9)
3: AC3 EX, English, 5.1 channels, 640kbps, 48kHz, dialnorm: -27dB
4: TrueHD/AC3, English, 5.1 channels, 48kHz, dialnorm: -27dB
(embedded: AC3 EX, 5.1 channels, 640kbps, 48kHz, dialnorm: -27dB)
[a03] Extracting audio track number 3...
[a04] Extracting audio track number 4...
[a04] Extracting TrueHD stream...
[a04] Removing TrueHD dialog normalization...
[a04] Decoding with libav/ffmpeg...
[a04] Writing WAVs...
[a03] Removing AC3 dialog normalization...
[a03] Decoding with libav/ffmpeg...
[a03] Reducing depth from 64 to 24 bits...
[a03] Writing WAVs...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.R.wav"...
[a03] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_3_audio.LFE.wav"...
[a03] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_3_audio.R.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.SR.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.LFE.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.C.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.L.wav"...
[a03] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_3_audio.C.wav"...
[a03] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_3_audio.SR.wav"...
[a03] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_3_audio.SL.wav"...
[a03] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_3_audio.L.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.SL.wav"...
[a04] The original audio track has a constant bit depth of 16 bits.
[a04] Superfluous zero bytes detected, will be stripped in 2nd pass.
[a04] Starting 2nd pass...
[a04] Extracting audio track number 4...
[a04] Extracting TrueHD stream...
[a04] Removing TrueHD dialog normalization...
[a04] Decoding with libav/ffmpeg...
[a04] Reducing depth from 24 to 16 bits...
[a04] Writing WAVs...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.SR.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.L.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.C.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.R.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.SL.wav"...
[a04] Creating file "C:\MainMovie\AP_SPY_WHO_SHAGGED_BD01\BDMV\STREAM\1_4_audio.LFE.wav"...
[a04] The processed audio track has a constant bit depth of 16 bits.
Video track 2 contains 136729 frames.
eac3to processing took 12 minutes, 12 seconds.
Done.]

If I'm reading this right, the ac3 is 24 bits and the truehd is 16 bits?
Reply
#19
TV's Frink Wrote:If I'm reading this right, the ac3 is 24 bits and the truehd is 16 bits?

You are reading it right. That explains the difference.

EDIT: I would use the WAVs from the TrueHD and not worry about it. Besides, I'm not sure Vegas Movie Studio can do 24-bit audio.

I have to go now. If for some reason you do need to use the AC-3 EX track and want 16-bit WAVs, you can add -down16 to the + Options box to reduce the bit-depth. Good luck, Frink!
The fault, dear Brutus, is not in our stars, but in ourselves.

Captain Khajiit's Basic Cross-platform Guide to Handling UHD
Captain Khajiit's Basic Guide to Decoding Video and Audio
Captain Khajiit's Quick Guide to Encoding a BD via the Command-line
Captain Khajiit's Basic Guide to Encoding with HCenc

For tech support, PM me (politely) or use the @+username function: I rarely read through threads these days.
Reply
#20
Captain Khajiit Wrote:3e) Decoding VC-1

Coming soon!

I anxiously await the good Captain's return and completion of this section Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)