avalonmediasystem/matterhorn-distribution-service-hls — pull request #1 by mikedurbin (2014-10-10 14:00:05+00:00)
Title: Relative path bug (https://bugs.dlib.indiana.edu/browse/VOV-1417)

The output filename(s) were included in the command line arguments for ffmpeg. The way the inherited encoder was implemented expected the command line arguments not to change between invocations of encode() and stored them in a member variable.

When the encoder was used concurrently, the filename (coming from the member variable) was used after processing to fix up the playlist file and was often incorrect because subsequent calls resulted in changes to that path.

The fix is that FFMpegHLSEncoderEngine no longer deviates (as much) from the super class's pattern of behavior. What it produces is now a playlist file with a random (and unique) name as well as ts files that also have that naming pattern. Once it completes an item, the HLSDistributionService processes the playlist file making all paths relative, renaming the ts files to the more idealize name and moves them all to the expected output directory.

This *may* have performance impacts if the working directory and the expected output directory are on different mounted volumes (the renameTo command might be expensive).