Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Splitting FLAC Into Tracks Without Transcoding? #124

Open
Martin2112 opened this issue Mar 14, 2022 · 4 comments
Open

Splitting FLAC Into Tracks Without Transcoding? #124

Martin2112 opened this issue Mar 14, 2022 · 4 comments
Assignees
Labels

Comments

@Martin2112
Copy link
Contributor

Hi,

I'm not saying this is a bug as I might be doing something wrong but I'd expect to be able to split album FLAC files into tracks without transcoding with something like:

/usr/local/bin/ffmpegfs \
        -f \
        --log_stderr \
        --log_maxlevel=DEBUG \
        --autocopy=MATCH \
        --prebuffer_size=2M \
        --cachepath=/var/cache \
        --min_diskspace=5G \
        /export/cdrip/flac \
        /export/cdrip/flactrack \
        -o allow_other,ro,desttype=flac

However, it seems to be behaving strangely. When I look at the directory:

ls -l /export/cdrip/flactrack/Music/Rush/Rush\ -\ Power\ Windows.flac.tracks/
total 0
-rwxr--r--. 1 martin martin 0 Mar  7 18:28 '01. Rush - The Big Money [05-36.226].flac'
-rwxr--r--. 1 martin martin 0 Mar  7 18:28 '02. Rush - Grand Designs [05-05.240].flac'
-rwxr--r--. 1 martin martin 0 Mar  7 18:28 '03. Rush - Manhattan Project [05-05.000].flac'
-rwxr--r--. 1 martin martin 0 Mar  7 18:28 '04. Rush - Marathon [06-09.160].flac'
-rwxr--r--. 1 martin martin 0 Mar  7 18:28 '05. Rush - Territories [06-19.466].flac'
-rwxr--r--. 1 martin martin 0 Mar  7 18:28 '06. Rush - Middletown Dreams [05-15.466].flac'
-rwxr--r--. 1 martin martin 0 Mar  7 18:28 '07. Rush - Emotion Detector [05-10.333].flac'
-rwxr--r--. 1 martin martin 0 Mar  7 18:28 '08. Rush - Mystic Rhythms [06-01.880].flac'

When I try to play these files in VLC they usually remain empty and I get an error. I can see some activity in the debug log. Sometimes it seems to work and I see a transcoding thread running in the debug output, which wasn't expected.

Also when restarting the files go back to zero bytes, should the cache not have provided file size for these? E.g. after this:

2022-03-14 17:55:23 DEBUG  : [/export/cdrip/flac/Music/Rush/Rush - Power Windows.flac.tracks/01. Rush - The Big Money [05-36.226].flac] Preparing next file: /export/cdrip/flac/Music/Rush/Rush - Power Windows.flac.tracks/02. Rush - Grand Designs [05-05.240].flac
2022-03-14 17:55:23 DEBUG  : [/var/cache/ffmpegfs/export/cdrip/flactrack/export/cdrip/flac/Music/Rush/Rush - Power Windows.flac.tracks/01. Rush - The Big Money [05-36.226].flac.cache.flac] Reading cache file.

The file still shows up as zero bytes. The cache is populated:

[root@zen martin]# ls -l /var/cache/ffmpegfs/export/cdrip/flactrack/export/cdrip/flac/Music/Rush/Rush\ -\ Power\ Windows.flac.tracks/
total 286096
-rw-r--r--. 1 martin martin 38786328 Mar 14 17:55 '01. Rush - The Big Money [05-36.226].flac.cache.flac'
-rw-r--r--. 1 martin martin 35401186 Mar 14 17:30 '02. Rush - Grand Designs [05-05.240].flac.cache.flac'
-rw-r--r--. 1 martin martin 33297260 Mar 14 17:24 '03. Rush - Manhattan Project [05-05.000].flac.cache.flac'
-rw-r--r--. 1 martin martin 40590110 Mar 14 17:23 '04. Rush - Marathon [06-09.160].flac.cache.flac'
-rw-r--r--. 1 martin martin 39808072 Mar 14 17:24 '05. Rush - Territories [06-19.466].flac.cache.flac'
-rw-r--r--. 1 martin martin 34131653 Mar 14 17:24 '06. Rush - Middletown Dreams [05-15.466].flac.cache.flac'
-rw-r--r--. 1 martin martin 33206500 Mar 14 17:24 '07. Rush - Emotion Detector [05-10.333].flac.cache.flac'
-rw-r--r--. 1 martin martin 37395713 Mar 14 17:28 '08. Rush - Mystic Rhythms [06-01.880].flac.cache.flac'

If I change desttype to 'mp3' then everything seems to work properly, though with delays for transcoding.

@nschlia nschlia self-assigned this Mar 17, 2022
@nschlia nschlia added the bug label Mar 17, 2022
@nschlia
Copy link
Owner

nschlia commented Mar 17, 2022

Cue sheets without transcoding are not implemented. This one totally escaped me, --autocopy=MATCH should not trigger copy when a cue sheet exists.
I'll add a check and automatically transcode in that case.
It could even be possible to retrack without transcoding, but this is rather complicated: For mp3 it would require at least partially recoding (at the start end of of tracks), not sure what FLAC requires, that'll be an enhancement.

As a work around you should remove the autocopy parameter and set --recodesame=YES instead.

@Martin2112
Copy link
Contributor Author

OK thanks. I'll try making those changes.

From what I understand from the FLAC spec it would be the same process as MP3 as the offsets are in terms of decoded frames.

@Martin2112
Copy link
Contributor Author

That does work better. I still have issues where some FLAC files produce zero length tracks. While looking into that I came across another CUE sheet parsing issue. I'll create an issue for that and try to propose a fix.

@nschlia
Copy link
Owner

nschlia commented Mar 19, 2022

That does work better. I still have issues where some FLAC files produce zero length tracks. While looking into that I came across another CUE sheet parsing issue. I'll create an issue for that and try to propose a fix.

Thanks. Looking forward to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants