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

AbstractProgressListener: remove totalSize null check #905

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

FacuM
Copy link

@FacuM FacuM commented Jun 6, 2023

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets fixes #794
Related issues/PRs #794
License MIT

What's in this PR?

This PR removes the null check for $this->totalSize present in the AbstractProgressListener class. This validation isn't necessary for the whole progress-tracking mechanism to work and only helps to estimate a more precise value by adding $this->rate to the math.

Why?

I was testing the progress tracker for my Laravel app and found out that it wasn't working at all. I've read that it was related to the WebM format but it didn't work with X264 either. Later on, I realized that the problem was related to my input instead and the fact that ffprobe won't estimate the total size for a sequential input (as in, for a timelapse).

i.e.: ffprobe 'snapshots/XYZC-04offset_7m_0.28mm_205C_PLA_ENDER2PRO_647e82d24817e1.53198987_%d.jpg' -show_format

See how the output for this command does not report a valid size, declaring N/A instead.

[...]
Input #0, image2, from 'snapshots/XYZC-04offset_7m_0.28mm_205C_PLA_ENDER2PRO_647e82d24817e1.53198987_%d.jpg':
  Duration: 00:00:32.76, start: 0.000000, bitrate: N/A
  Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc, bt470bg/unknown/unknown), 640x360, 25 fps, 25 tbr, 25 tbn, 25 tbc
[FORMAT]
filename=snapshots/XYZC-04offset_7m_0.28mm_205C_PLA_ENDER2PRO_647e82d24817e1.53198987_%d.jpg
nb_streams=1
nb_programs=0
format_name=image2
format_long_name=image2 sequence
start_time=0.000000
duration=32.760000
size=N/A
bit_rate=N/A
probe_score=100
[/FORMAT]

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

Successfully merging this pull request may close these issues.

Not receiving progress notifications
1 participant