I have a Node.js program that periodically loops through video files in a directory. If a file is added or removed, the program updates a database to reflect this change. When a file is added, FFmpeg is used to generate a thumbnail.
I have problems when I try and run FFmpeg on a file that is currently being copied to the directory. As the file is not complete, FFmpeg cannot generate a thumbnail. If I knew when a file is being copied, I could ignore it, and it would be picked up next time the directory is scanned.
How do I determine if a file is currently being copied, or how should I loop a directory ignoring currently copying files?
via user2248702
No comments:
Post a Comment