Skip to content

fix: unblock ffmpeg on some broken videos #53000

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

Merged
merged 1 commit into from
Jun 10, 2025
Merged

Conversation

blizzz
Copy link
Member

@blizzz blizzz commented May 20, 2025

Summary

On some (semi-)broken videos it might be, that we do not get information with SDTOUT and keep waiting for it. Because it is an external process, the PHP time limit is not in effect. Checking STDERR first solves this problem interestingly.

TODO

  • Provide a test data video of 560x320 size to not cause flaky tests due to randome test values in \Test\Preview\Provider::dimensionsDataProvider.

Checklist

@blizzz blizzz added this to the Nextcloud 32 milestone May 20, 2025
@blizzz blizzz added bug 2. developing Work in progress labels May 20, 2025
@kesselb
Copy link
Contributor

kesselb commented May 20, 2025

Thanks for taking care @blizzz 👍

I recall some older PRs that aimed to achieve the same goal. They might be useful for you:

@nickvergessen

This comment was marked as resolved.

@nickvergessen
Copy link
Member

Updated the video, fixed cs and reuse, should be good for a final rebase

@blizzz blizzz force-pushed the fix/noid/stuck-ffmpeg branch from b4b9a30 to 9cd180e Compare May 20, 2025 20:10
Co-authored-by: Joas Schilling <[email protected]>
Signed-off-by: Arthur Schiwon <[email protected]>
@blizzz blizzz force-pushed the fix/noid/stuck-ffmpeg branch from 9cd180e to bdc6898 Compare May 20, 2025 20:12
@blizzz blizzz marked this pull request as ready for review May 20, 2025 20:12
@blizzz blizzz requested a review from a team as a code owner May 20, 2025 20:12
@blizzz blizzz requested review from icewind1991, artonge and leftybournes and removed request for a team May 20, 2025 20:12
@blizzz blizzz added 3. to review Waiting for reviews and removed 2. developing Work in progress labels May 20, 2025
@blizzz blizzz requested a review from a team May 20, 2025 20:13
@blizzz
Copy link
Member Author

blizzz commented May 20, 2025

Thanks for taking care @blizzz 👍

I recall some older PRs that aimed to achieve the same goal. They might be useful for you:

* [fix(preview): ffmpeg gets stuck when getting video cover #45722](https://github.com/nextcloud/server/pull/45722) @ncheng89

* [movie preview bug fix, in some case stream reading functions may block indefinitely #43226](https://github.com/nextcloud/server/pull/43226) @jpsn123

Thanks for linking them!

The latter looks interesting (this part is also in the first one), would need more testing though. If this works properly, it appears more reliable than just preferring STDERR.

@blizzz
Copy link
Member Author

blizzz commented May 20, 2025

/backport to stable31

@blizzz
Copy link
Member Author

blizzz commented May 20, 2025

/backport to stable30

@AndyScherzinger
Copy link
Member

@blizzz ready to go or you want to include something from #43226 ?

@blizzz
Copy link
Member Author

blizzz commented Jun 10, 2025

@blizzz ready to go or you want to include something from #43226 ?

Let's go with this and rebase the second one. Should be mergable as is if the relevant tests remain green.

Copy link
Contributor

@kesselb kesselb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works 👍

I don't understand why, but it's nice 😆

@kesselb kesselb merged commit e1fcd6c into master Jun 10, 2025
204 of 208 checks passed
@kesselb kesselb deleted the fix/noid/stuck-ffmpeg branch June 10, 2025 20:22
@kesselb
Copy link
Contributor

kesselb commented Jun 10, 2025

/backport to stable29

Copy link

backportbot bot commented Jun 10, 2025

The backport to stable29 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout stable29
git pull origin stable29

# Create the new backport branch
git checkout -b backport/53000/stable29

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick bdc68989

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/53000/stable29

Error: Failed to check for changes with origin/stable29: No changes found in backport branch


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

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

Successfully merging this pull request may close these issues.

4 participants