Log in

View Full Version : ffmpeg->sox->wav wav/w64 length?


Selur
10th September 2012, 15:03
Can someone explain me what's happening, I call:
ffmpeg -y -analyzeduration 500000000 -threads 8 -v -10 -i "H:\Output\test.dts" -ac 6 -f sox - | sox --multi-threaded --temp "H:\Temp" --buffer 524288 -S -t sox - --endian little -b 24 -t wavpcm "H:\Output\test_raw_15_13_53_21100.wav" gain -6 treble +6
to convert a 2:37h clip and the output is indicated as 1:14:58.
If I play the output in VLC/MPC-HC or anylse it with MediaInfo they all play/indicate only ~1:15h.
If I rename the extension to w64, MPC-HC indicates it with the right length but only plays till 1:14:58, than it jumps to the end.
If I remux the file with mkvmerge into a .mkv file the whole 2:37h are accessible.

When I use '-t wav' instead of '-t wavpcm' everyone except MPC-HC still indicates 1:14:58, MPC-HC however indicates the right length, but still can't play beyond 1:14:58.

Loading any of the wav files into delaycut, it shows:
====== INPUT FILE INFO ===============
File is wav
Bitrate (kbit/s) 6912000
Act rate (kbit/s) 6912000.000
File size (bytes) 8181605456
Channels mode 6 Channels
Sampling Frec 48000
Byte rate (kbit/s) 864000
Bits of Prec. 24
Duration 02:37:49.450
Sample length (ms) 0.020833
Num of samples 215924337
Bytes per Sample 18
Size % Sample size 14
======================================
====== TARGET FILE INFO ==============
Start Sample 0
End Sample 215924336
Num of Samples 215924337
Duration 01:14:58.423
NotFixedDelay 0.0000

So now I'm confused and don't really know what's happening. :)

Cu Selur

Groucho2004
10th September 2012, 15:09
Very few programs read wav files > 4GB. Adobe Audition v2+ is one of them. Aften also reads them but you have to specify "-readtoeof" to ignore the wave header.

Selur
10th September 2012, 15:11
But if this is only a 2GB problem, shouldn't MediaInfo indicate the right length?

Groucho2004
10th September 2012, 15:14
But if this is only a 2GB problem, shouldn't MediaInfo indicate the right length?

It's 4G and I'm not sure about Mediainfo. What does eac3to have to say about the file?


Edit: I'm trusting MediaInfo less and less when it comes to audio files. Just recently it showed the wrong length for an ac3 file. eac3to seems much more reliable.

Selur
10th September 2012, 15:19
eac3to indicates: 'WAV, 5.1 channels, 2:37:49, 24 bits, 6912kbps, 48kHz'
So, the file I create should be fine, but most of the world can't handle the format properly?

Cu Selur

Groucho2004
10th September 2012, 15:23
eac3to indicates: 'WAV, 5.1 channels, 2:37:49, 24 bits, 6912kbps, 48kHz'
So, the file I create should be fine, but most of the world can't handle the format properly?

Cu Selur

The problem is that the standard wave header does not support more than 4G (-> "RIFF Chunk Size" is a DWORD).
Some programs simply ignore the value and keep reading the samples until the end of the file.

Selur
10th September 2012, 15:26
Okay, thanks for the help, at least know I'm not as confused as before. :)

Groucho2004
10th September 2012, 15:36
In case you're interested - Here (http://www.mediafire.com/download.php?hzdu49g17adog96) is a CPP class I wrote some time ago to read the header from WAV files. And yes, it reads files > 4G :)

Selur
10th September 2012, 16:25
Thanks. Changing -t wavpcm to -t w64, now at least MediaInfo, VLC, MPC-HC can handle the file correctly. :)

Groucho2004
10th September 2012, 16:35
If you have no compatibility issues then yes, w64 is the way to go.

Selur
10th September 2012, 16:36
Seems to work for now. :)