Closed Martin2112 closed 2 years ago
Sorry but this can't be fixed. The real file size will not be known unless the file had been fully decoded. This is because most formats use variable bit rates and the final file size heavily depends on the audio/video contents.
So the file sizes are just a guess at first.
Closed as not fixable.
OK but hasn't it already done that work? The file size should no longer be a guess?
OK but hasn't it already done that work? The file size should no longer be a guess?
The size will always be a guess. Even for WAV or MP3, where the size can precisely be calculated for the audio portion. But there are meta data parts that make even that impossible.
Sorry, I'm still not understanding why the size isn't coming from the sql db or the cache file once transcoding is complete?
I understand why it would be a guess for files that haven't been transcoded yet.
I think now I've got it: Until the files have been recoded, the size shown by ls -l is a guess. As explained, this cannot be fixed.
After recoding, the size is correct, and properly stored in the database. When ffmpegfs is restarted, all track file sizes go back to the guess. The original file retains the correct size, on the other hand. Only the virtual tracks have wrong sizes.
Appears that the sizes of virtual tracks are not read from the database like for "real" files.
I'll check into that.
OK, thanks for the time spent looking into the issues I've reported. If you visit London I'll buy you a beer!
OK, thanks for the time spent looking into the issues I've reported.
Thanks for your time spent reporting these issues and helping with fixes. I appreciate that.
If you visit London I'll buy you a beer!
That's dangerous. I might get back to it one day :)
The issue has grown bigger than I first thought:
Same problem applies to other virtual directories, DVD, VCD, Bluray and even HLS also. Same effect: After recode, the file size is correct. After ffmpegfs restart it is back to the guess, although the real value is stored in the database.
This has been around ever since the features have been added as the code that would retrieve the size does simply not exist...
Thanks for insisting on the topic.
Looks good so far, will do more testing.
Looks good so far, will do more testing.
For cuesheets this was actually working, but failed for some formats, FLAC being one of those. Happened when the file size could not be predicted (as for FLAC), after I fixed that, the size problem was gone as well :) For DVD, Bluray, Video CD and HLS this never worked. I forgot to implement the functionality in the first place... Anways, for DVD, Bluray, Video CD, HLS and cuesheets the cache file size now is used. This is the correct size, as the cached file is sent to the reading application. This is better than the database entry, as it may be wrong, and if the cache file should be gone (deleted) the size falls back to a guess. The source will be recoded in that case.
Hi again!
I think there might still be another file size issue after you fixed the main one. It's with flac -> flac transcoding as before. The database says the track file should be 27992970 bytes and it's finished.
And if you read the file the data you get matches this length:
But ls thinks it's shorter at 24014389 bytes:
This confuses players into finishing playback early.