svt / encore

Transcode media files in an epic manner
European Union Public License 1.2
273 stars 25 forks source link

Job hangs indefinitely if output for thumbnailmap encode already exists #23

Closed grusell closed 8 months ago

grusell commented 9 months ago

Describe the bug If one for whatever reason run multiple jobs with identical outputFolder/baseName, and the profile includes a thumbnailmap encode, the job never finishes.

This seems to be caused by the postprocessing step in Thumbnailmapencode. If the output file for the thumbnailmap postprocessing already exists, ffmpeg process will hang forever waiting for user confirmation that the file should be overwritten.

To Reproduce Steps to reproduce the behavior:

  1. Start a job using a profile with a thumbnailmap encode
  2. When the job finishes, start another identical job
  3. Job never finishes

Expected behavior Job should finish and overwrite the old thumbnailmap.

Suggested fix


index d3cd406..2ce7e73 100644
--- a/encore-common/src/main/kotlin/se/svt/oss/encore/model/profile/ThumbnailMapEncode.kt
+++ b/encore-common/src/main/kotlin/se/svt/oss/encore/model/profile/ThumbnailMapEncode.kt
@@ -80,6 +80,7 @@ data class ThumbnailMapEncode(
                     val targetFile = outputFolder.resolve("${job.baseName}$suffix.$format")
                     val process = ProcessBuilder(
                         "ffmpeg",
+                        "-y",
                         "-i",
                         "${job.baseName}$suffix%04d.$format",
                         "-vf",```
fhermansson commented 8 months ago

Thank you for reporting! We will look at it for the next release.

fhermansson commented 8 months ago

It's fixed in v0.2.2