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

SmartCut extreme quality degradation for encoded part due to incorrect detected bitrate from stream #1997

Closed
5 tasks done
adzm opened this issue May 15, 2024 · 2 comments
Closed
5 tasks done

Comments

@adzm
Copy link

adzm commented May 15, 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

I was experimenting with SmartCut on a file; using developer tools I saw that the bitrate parsed for the stream is only 97 kb/s. The average bitrate based on file size is around 4000 kb/s. Using ffprobe I see this info:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'smartcuttest.mp4':
Metadata:
major_brand : dash
minor_version : 0
compatible_brands: iso6avc1mp41
creation_time : 2019-07-25T11:46:15.000000Z
Duration: 00:03:50.46, start: 0.000000, bitrate: 4007 kb/s
Stream #0:00x1: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 97 kb/s, 29.97 fps, 29.97 tbr, 30k tbn (default)

which explains where the 97 kb/s part comes from. I am uncertain why ffprobe is giving this value, unfortunately. The video file only has one stream, no audio.

I put a copy of the file here for now: http://adzm.net/losslesscut/smartcuttest.mp4

While I am uncertain how to handle this situation, it would be nice to have an option at least to toggle between estimating a bitrate based on file size and attempting to determine the bitrate from the stream, perhaps, or allow setting it explicitly. Since this is usually a small part of the overall exported segment, I would personally prefer that the bitrate is as high quality as possible.

Expected behavior

The encoded part of the SmartCut segment should be visually similar in quality to the rest of the file.

Actual behavior

The encoded part of the SmartCut segment is laughably poor quality at 1/40th of the bitrate in this particular case.

Share log from developer tools

No response

@adzm adzm mentioned this issue May 15, 2024
8 tasks
@adzm
Copy link
Author

adzm commented May 15, 2024

Unfortunately, modifying the source to just always use (for example) an 8 megabit bitrate still ends up producing strange / glitched output in some situations, though i think that is a different issue.

Also, I noticed the encode of the smartcut parts is not put into the ffmpeg command log, it appears? which makes it trickier to try to reproduce and debug locally.

@mifi
Copy link
Owner

mifi commented May 15, 2024

I will think about this.

Also, I noticed the encode of the smartcut parts is not put into the ffmpeg command log, it appears? which makes it trickier to try to reproduce and debug locally.

i will fix that

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

No branches or pull requests

2 participants