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

Problems splitting certain audio files #2140

Open
4 tasks done
Mrnofish opened this issue Sep 1, 2024 · 5 comments
Open
4 tasks done

Problems splitting certain audio files #2140

Mrnofish opened this issue Sep 1, 2024 · 5 comments
Labels
bug ffmpeg Problem resides in ffmpeg or usage of ffmpeg

Comments

@Mrnofish
Copy link

Mrnofish commented Sep 1, 2024

The fewer issues I have to read, the more new features I will have time to implement, so I ask that you please try these things first

Operating System

Windows 10

Steps to reproduce

  1. Split audio file in one of the format mentioned below, three parts should be sufficient.
  2. Verify Integrity (under Windows I've used foobar2000)

Expected behavior

Split files should pass integrity checks.

Actual behavior

Depending on the format, various warnings are triggered. I've tested four:

  • mp3 and AAC (works correctly)
  • Opus (triggers granulepos is non-sense and incorrect length)
  • FLAC (incorrect length and MD5 mismatch)

Opus files have small differences (some millisecs) versus the reported lengths.

FLAC has the MD5 and length of the original file.

I didn't report this through the specific format form since it happens with at least two and possibly more formats. I haven't looked into ffmpeg to figure whether this is an issue with the build or version that LosslessCut is using, or perhaps it having a rough/incomplete implementation for audio splitting.

I've verified this happens both with 3.61 and 3.62.

Disabling Keyframe Cut eliminates the granulepos is nonsense warning but inaccurate lengths remain.

Share log from developer tools

No response

@mifi
Copy link
Owner

mifi commented Sep 3, 2024

FLAC has the MD5 and length of the original file.

this is a bug in ffmpeg where it doesn't update the length when cutting. I've fixed it (upcoming version) with a workaround which is to actually re-encode the flac (which is lossless because flac is a lossless codec) see #1809

Disabling Keyframe Cut eliminates the granulepos is nonsense warning

that's interesting.

the OPUS problem is probably also a bug in ffmpeg, so not much that can be done here i think

@mifi mifi added bug ffmpeg Problem resides in ffmpeg or usage of ffmpeg labels Sep 3, 2024
@Mrnofish
Copy link
Author

Mrnofish commented Sep 3, 2024

ffmpeg outputting partially broken files not being their problem is a pretty dizzying deflection. Is LosslessCut using the --copy option for Opus, too?

Are you aware of any library/tool that can rebuild Opus files? opustools doesn't seem to provide any.

@mifi
Copy link
Owner

mifi commented Sep 3, 2024

ffmpeg outputting partially broken files not being their problem is a pretty dizzying deflection. Is LosslessCut using the --copy option for Opus, too?

i meant to say that there's not much i can do, because i don't know the internal implementation details of ffmpeg nor do i know much about the opus codec. but surely if someone wants to fix it, that would be great.

Is LosslessCut using the --copy option for Opus, too?

yes

Are you aware of any library/tool that can rebuild Opus files? opustools doesn't seem to provide any.

no

@Mrnofish
Copy link
Author

Mrnofish commented Sep 3, 2024

Oh, I got that and wasn't blaming you ...that would be madness!

I was referring to the reply provided on the first ffmpeg ticket linked in #1809 which argues that, since the --copy option only copies stuff, then it's okay for the length of the output file to be incorrect, thus transferring the burden of detecting and solving any problem on the user and/or another piece of software. Never mind that splitting a file isn't making a straight copy.

Apologies for any confusion.

Since I assume you have a certain experience with ffmpeg bugs and reporting them, any chance that upstream would fix Opus related bugs if a ticket were to be opened?

@mifi
Copy link
Owner

mifi commented Sep 5, 2024

Ahh ok, no worries.

TBH I haven’t reported too many bugs upstream but there are some other llc users who have done it in the past. If you’re able to find a simple ffmpeg command that can reproduce the problem with a small opus file, I’m sure it’s worth trying to report it. (Assuming it hasn’t already been reported like the flac issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ffmpeg Problem resides in ffmpeg or usage of ffmpeg
Projects
None yet
Development

No branches or pull requests

2 participants