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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No errors in conversion but the generated file is not playable

alekdavis opened this issue · comments

I am not sure if this is a problem with ffmpeg or with the way it gets called, but I just converted one MKV file and conversion went fine:

>>>>> New Session (started 11/24/20 14:23:45)

There are 1 file(s) in the queue:

1. \\NAS\Share\XXX.mkv

------------------------------------------------------------------------------------
11/24/20 14:23:45 Processing - \\NAS\Share\XXX.mkv
11/24/20 14:23:45 File 1 of 1 - Total queue 100%
11/24/20 14:23:48 Video: H264, Audio: AC3. Encoding audio to AAC
11/24/20 14:38:47 Plex libraries refreshed
11/24/20 14:38:50 \\NAS\Share\XXX.mkv deleted.
11/24/20 14:38:50 \\NAS\Share\XXX.mp4 created.
11/24/20 14:38:50 New file is 474.20MB smaller.
11/24/20 14:38:50 Current cumulative storage difference: -474.20MB

____________________________________________________________________________________

11/24/20 14:38:50 Total cumulative storage difference: -474.20MB

02:14:58 of video processed in 00:15:05
Average conversion speed of 8.94x

Audio-only encodes: 1

The original file was fine, but when I tried to play the MP4, it would not work with any video player (tried Plex, VLC). I checked MediaInfo and all streams are gone (the MKV has one video stream, three audio streams, and five subtitle streams). Tried to run the converter twice just in case and the result was the same.

commented

Hey Alek, that's really odd. Every once in a blue moon, I'll have a similar issue, and can't ever find the root cause (I've had this happen maybe twice over the course of tens of thousands of conversions). I suspect the original file was encoded in some non-standard way that causes ffmpeg to get confused when its re-encoding. The various info ffmpeg outputs to stdin/stderr doesn't necessarily get recorded in the conv2mp4 log unless they're part of a specific script operation, so if you come across this issue again, watch the actual script execution output (which will show the ffmpeg output) to see if there are any unusual messages. I'd suggest making a copy of the file in question outside of your media path as a backup, as well.

Yeah, I wish I knew that this was an issue in advance. I did the conversion without keeping the original backups, and I think I lost about 10% or so of the videos. Switched to using HandBrake.