jlesage / docker-handbrake

Docker container for HandBrake
MIT License
856 stars 97 forks source link

Is it possible to delay file copy until conversion is complete? #269

Open vdrover opened 1 year ago

vdrover commented 1 year ago

i am using these environment variables in my docker compose:

AUTOMATED_CONVERSION_NON_VIDEO_FILE_ACTION: "copy"`
AUTOMATED_CONVERSION_NON_VIDEO_FILE_EXTENSIONS: "nfo jpg png bif srt"

In my case, Emby starts recording live TV show and creates a folder and some non-video files like poster.jpg and tvshow.nfo in the watch folder.

As soon as the folder and files are created, and before the recording is complete, Handbrake immediately copies the non-video files to the output folder, removing them from the watch folder.

Emby in the meantime shows the active recordings on the Emby Dashboard. However, since poster.jpg has been moved, the preview is not available. This all gets sorted out once the recording stops and the converted file gets moved the output folder, but for typical users it looks a bit weird (Dashboard with "empty" icons).

I wondered if there was a way to delay the copy function until all the video files were processed. This would keep the non-video files in the watch folder until the video file conversion was complete.

jlesage commented 11 months ago

You can probably achieve this via "hooks". You configures the container to write videos to another folder. Once completed, you use a hook to move files to the Emby's folder.