Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Converting File Bigger Than 4GiB. (Read 468 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Converting File Bigger Than 4GiB.

Good evening,

I'm trying to convert a large FLAC file (a bit over two hours of 24/96 stereo) to lossyFLAC in foobar2000 (v1.6.13) using piped output from foobar2000 to a command line encoder piping output to flac.exe and I experience a failure with the following message:
Code: [Select]
1 out of 1 files converted with major problems.

Source: "H:\Test\Test.flac"
  An error occurred while finalizing the encoding process (Object not found) : "H:\Test\lossyFLAC\Test.flac"
  Conversion failed: Object not found
Dumping chunk sizes from the piped data I get:
Code: [Select]
RIFF; -1
fmt ; 16
data; -1
Noting that command line FLAC terminates with the following error:
Code: [Select]
Test.flac: ERROR: stream is too big to fit in a single WAVE file
I'm wondering if there's anything I'm missing with regard to how files with an uncompressed size of over 4GiB are handled by foobar2000.

Any advice would be very much appreciated.
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

Re: Converting File Bigger Than 4GiB.

Reply #1
The build-in FLAC profile in foobar's converter uses parameters --ignore-chunk-sizes with FLAC. As the name suggests that makes the encoder ignore the short length in WAV header and encode until EOF.

Re: Converting File Bigger Than 4GiB.

Reply #2
Thanks very much for the prompt response, Case.

Can you please advise if it is foobar2000 that is deleting the output file (that is very much being created while the processing dialog is active)? If so, what are the conditions for such a deletion.

Given that command line FLAC can be told to output to WAVE64 and RF64, and if it is possible to do so in the FLAC library in use in foobar2000, has any consideration been given to exposing these as an option in the converter?
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)

Re: Converting File Bigger Than 4GiB.

Reply #3
All decoders in foobar2000 decode to foobar's internal format, in 32-bit foobar2000 that's 32-bit float and in 64-bit foobar2000 it's 64-bit float. The converter recreates the chosen bitdepth integer PCM format from the float data. FLAC library abilities are irrelevant.

In the Converter's 'Other' section there's an option 'Leave partial files for aborted or failed conversions'. Enabling that will stop foobar2000 from deleting the temp files.

So far there hasn't been need to provide option to send anything other than WAVE over pipes, as regular WAV format is the most supported and generally encoders have options to ignore lengths for exactly this purpose.

But if you don't want to work with pipes, the Converter can write Wave64 file directly. Just pick that as the output format and create a temporary file to the disk.

 

Re: Converting File Bigger Than 4GiB.

Reply #4
I checked the option in the converter's "Other" section. The converter reported the same error and the file was still deleted - which suggests it's not a foobar2000 issue.

Understood about WAV over pipes and the --ignore-chunk-sizes option found in encoders. I prefer to use piped encoding as it's much faster (and uses up less of the lifetime write of SSDs).

Further checking, by removing lossyWAV from the command line and piping foobar2000 output to command line FLAC, has also ruled out command line FLAC as the culprit. It seems that my --ignore-chunk-sizes option in lossyWAV is not working as intended.

Many thanks again for taking the time to explain foobar2000's piped output and converter options that I had previously missed. Very much appreciated.

[edit] Found the culprit - the calculation of padding bytes to write after each chunk for WAV files assumed that the number of bytes written would not exceed the limit of an unsigned 32-bit integer, which is entirely incompatible with the --ignore-chunk-sizes option that is there to handle WAV data that exceeds that limit. [/edit]
lossyWAV -q X -a 4 -s h -A --feedback 2 --limit 15848 --scale 0.5 | FLAC -5 -e -p -b 512 -P=4096 -S- (having set foobar to output 24-bit PCM; scaling by 0.5 gives the ANS headroom to work)