magmastonealex / ffproc

A batch transcoding system. Supports multiple remote workers.
Apache License 2.0
46 stars 4 forks source link

FFproc removes video files if only adding audio track and not changing container #18

Open alocklear opened 5 years ago

alocklear commented 5 years ago

If scanning directory of mp4/mkv files with final container to be mp4. If video file contains a surround sound channel, ffproc adds a second 2 channel file to the working copy as expected, then moves temp file over the original video file if original container was mp4 and proceeds to remove the original file. The end result is original video file is deleted. I added check into worker.py to ensure infile and outfile are not same before removal. This worked for my use case. I wanted to ensure fix was reported.

Below is the modified lines added to worker.py at line 35: if torun.infile != torun.outfile: os.remove(torun.infile)

magmastonealex commented 5 years ago

Thanks for the bug report, and for giving ffproc a try!

I apologize for that - I do hope you didn't lose any data because of that bug.

I'll make a commit in a few days with that change.