BrianDMG / conv2mp4

This Powershell script will recursively search through a user-defined file path and convert all videos of user-specified file types to MP4 with H264 video and AAC audio using ffmpeg. The purpose of this script is to reduce transcoding CPU load on a media server like Plex or Emby and increase video compatibility across platforms.
129 stars 23 forks source link

Prevent reencoding the same file twice. #33

Closed belrpr closed 6 years ago

belrpr commented 6 years ago

Hi,

is there an option to check if the file is already in the correct format? So if I let it run on my videos it won't reconvert them the next day when I run it again.

BrianDMG commented 6 years ago

Hey, by default the script deletes the source file once it has been converted unless it fails over twice (once to handbrakeCLI, then fails there, as well), so files should not be being converted more than once. Please post an example of your log where this is happening or provide some more specific information if the script is not deleting the source files once they've been successfully converted, then re-open the issue.

belrpr commented 6 years ago

Hi,

What I mean is: I've got a plex library: d:\Media\Movies d:\Media\Series

So I use d:\media as the input directory for the script. it contains avi, mp4, mkv, ... If the script runs it will create an mp4. Next time that the script runs it finds the created mp4 and will to a "SimpleConvert because the video is already H264 and the audio is already AAC.

Met vriendelijke groeten Tom L'Ecluse IT-Source

2017-11-10 2:44 GMT+01:00 Brian notifications@github.com:

Hey, by default the script deletes the source file once it has been converted unless it fails over twice (once to handbrakeCLI, then fails there, as well), so files should not be being converted more than once. Please post an example of your log where this is happening or provide some more specific information if the script is not deleting the source files once they've been successfully converted, then re-open the issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/BrianDMG/conv2mp4-ps/issues/33#issuecomment-343349851, or mute the thread https://github.com/notifications/unsubscribe-auth/Af4CKUnCgYyMNWpbMweeSrkjRSo_MMrvks5s06qFgaJpZM4QUI50 .

djgrijalva commented 6 years ago

It wont scan the file twice since mp4 is in not in the $fileTypes config $fileTypes = ".mkv", ".avi", ".flv", ".mpeg", "*.ts" #Do NOT add .mp4!