nschlia / ffmpegfs

FUSE-based transcoding filesystem with video support from many formats to FLAC, MP4, TS, WebM, OGG, MP3, HLS, and others.
https://nschlia.github.io/ffmpegfs/
GNU General Public License v3.0
196 stars 14 forks source link

No tracks folder despite there is cue file #114

Closed igor-epam closed 2 years ago

igor-epam commented 2 years ago

It's expected to have *.tracks/ folder in addition to cue + flac files for such files structure: $ ls -la . drwxrwxrwx 1 root root 4096 Nov 15 2019 . drwxrwxrwx 1 root root 4096 Nov 15 2019 .. drwxrwxrwx 1 root root 4096 Nov 16 2019 Cover -rwxrwxrwx 1 root root 24483 Nov 15 2019 Front.jpg -rwxrwxrwx 2 root root 1876 Nov 15 2019 'Volbeat - The Strength The Sound The Songs.cue' -rwxrwxrwx 2 root root 449289261 Nov 16 2019 'Volbeat - The Strength The Sound The Songs.flac' -rwxrwxrwx 2 root root 3413 Nov 15 2019 'Volbeat - The Strength The Sound The Songs.log'

whereas there is no *.tracks folder created with splitted tracks.

nschlia commented 2 years ago

Could you provide a log (after opening the output folder) with --log_maxlevel=TRACE?

Also, please attach the cue file.

igor-epam commented 2 years ago

out.log Volbeat - The Strength The Sound The Songs.cue.txt

Cue was renamed to cue.txt

nschlia commented 2 years ago

The cue file seems to be OK, I don't have that Volbeat album, so I renamed a different file (but that should make no difference).

The result is as expected. Please create a trace log, maybe this will brighten me up :)

:~/test/out$ ls -l -R
.:
insgesamt 322843
-rw-r--r-- 1 norbert norbert      1876  5. Jan 08:47 'Volbeat - The Strength The Sound The Songs.cue'
-rw-r--r-- 1 norbert norbert 330582527  5. Jan 08:31 'Volbeat - The Strength The Sound The Songs.flac'
drw-r--r-- 2 norbert norbert      4096  5. Jan 08:47 'Volbeat - The Strength The Sound The Songs.flac.tracks'

'./Volbeat - The Strength The Sound The Songs.flac.tracks':
insgesamt 0
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '01. Volbeat - Caroline Leaving [03-13.986].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '02. Volbeat - Another Day, Another Way [03-00.840].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '03. Volbeat - Something Else Or... [04-08.213].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '04. Volbeat - Rebel Monster [02-53.800].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '05. Volbeat - Pool Of Booze, Booze, Booza [03-35.720].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '06. Volbeat - Always, Wu [02-30.053].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '07. Volbeat - Say Your Number [04-42.946].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '08. Volbeat - Soulweeper [03-38.013].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '09. Volbeat - Fire Song [04-17.893].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '10. Volbeat - Danny & Lucy (11 pm) [02-51.933].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '11. Volbeat - Caroline #1 [04-13.013].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '12. Volbeat - Alienized [04-06.013].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '13. Volbeat - I Only Wanna Be With You [02-44.093].flac'
-rw-r--r-- 1 norbert norbert 0  5. Jan 08:47 '14. Volbeat - Everything'\''s Still Fine [03-19.000].flac'
:~/test/out$ 
igor-epam commented 2 years ago

The problem was that in my case option desttype=mp3 was excluded from command line. Including this option again gives expected output.

The reason of exclusion is to try to keep original bitrate & audio format. Is there some way to keep original file quality, extension and not transcode always to mp3? This is especially needed for lossless file formats.

nschlia commented 2 years ago

The problem was that in my case option desttype=mp3 was excluded from command line. Including this option again gives expected output.

I still do not understand what happened, by default (--recodesame=NO), when the original file is e.g. FLAC and --desttype=FLAC, it will not be recoded. But the tracks will be provided anyway if a cue file exists. When the original file is opened, it will be passed through. The tracks must be recoded.

With --recodesame=YES the original file is also recoded, but that makes no difference to the CUE sheet handling.

It would be interesting to see the TRACE log.

nschlia commented 2 years ago

The problem was that in my case option desttype=mp3 was excluded from command line. Including this option again gives expected output. The reason of exclusion is to try to keep original bitrate & audio format. Is there some way to keep original file quality, extension and not transcode always to mp3? This is especially needed for lossless file formats.

No. This is not possible, virtual tracks must be recoded.

Short explanation why:

Some source formats, like MP4, contain a single huge data section that cannot be simply divided into tracks. For other formats, e.g. mp3, it would actually be feasible. The format consists of frames, so tracks could be created by copying frames and starting a new track at a frame boundary. But this is not as easy as it sounds, as frames can contain backwards references to the predecessor. This means that at least a few frames at boundaries need recoding. Also frames contain a few dozen milliseconds, so this may cause tracks to start early/late...

All of that would required handling formats at file level, which FFmpegfs does not do. It simply relies on the FFmpeg API when reading/writing formats. I do not want to get into fiddling about file format issues (I've done that at some extend to be able to write file while they are accessed, but only at the smallest extend possible).

nschlia commented 2 years ago

Closed as no more can be done here. Splitting into tracks for cue sheets without recoding would be a huge task, there is another issue for that, see #124.