mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.88k stars 534 forks source link

ensure create_hls runs only after all encodings finish #1095

Open bobcarroll opened 4 weeks ago

bobcarroll commented 4 weeks ago

Description

This patch addresses #929 and #962 by ensuring that create_hls only runs Bento after all h264 encodings are finished. #957 may be fixed by this too as higher resolution encodings won't appear in the player selection without HLS.

Calling Bento with more than one media file doesn't work because the files argument is interpreted as a single (quoted) value. It seems like the original intention may have been to generate HLS files as each encoding finishes, and this case wasn't triggered until I eliminated duplicate runs of Bento.

938 didn't fix the problem for me. create_hls was (indirectly) being called from line 1588 of files/models.py and all of my uploads were failing to encode regardless of size. The encoded files were still created and visible in the web UI, with the exception of higher resolution encodings.

Steps

Upload a video file with Bento installed and properly configured.

mgogoulos commented 5 days ago

I'll need to have another look on this, as a quick fix I've commited https://github.com/mediacms-io/mediacms/commit/5a1e4f25ed41a6f3e6003b3c0afff76acf58d23a and released v4.2.0

Can you sync this branch, since there's a conflict to tasks.py?

Thanks

bobcarroll commented 7 hours ago

@mgogoulos done