theophanemayaud / video-simili-duplicate-cleaner

https://theophanemayaud.github.io/video-simili-duplicate-cleaner/
GNU General Public License v3.0
51 stars 5 forks source link

Error reading some Handbrake encoded files #12

Closed redblotch83 closed 3 years ago

redblotch83 commented 3 years ago

First off, LOVE this program. Have been looking for something like this for months. Just purchased it in the App Store to get you some $$ for the OSX compiling work. Now onto my issue.

I have a large amount of video files (16tb+), so I re-encode in handbrake to save space. It seems like the program has some issues reading some 4k (2160p/30fps and 60fps) files that were transcoded in handbrake to H265. When I open the videos, they play fine. Would love to see if there was anything I could do to get the files to read these 4k videos as I might also have the same video as a 1080p laying around on my hard drive. Since Handbrake uses FFmpeg to transcode, and there were no errors at the time of transcode, I'd image that it might just be a setting with that?

theophanemayaud commented 3 years ago

Thanks a lot !!! ❤️ Good question for h265, I don't actually have h265 files, or not enough to have seen a problem with it. Maybe I didn't enable h265 libs in FFmpeg, I'll check it out and see if there's a solution.

Do you get a specific error message in the main window for those videos ?

theophanemayaud commented 3 years ago

Also, as I bundle ffmpeg within the app to deploy it, the version of ffmpeg you use to encode might not be the same as the one I used for within the app. See https://github.com/theophanemayaud/video-simili-duplicate-cleaner#librariesdependencies you could try and replace the ffmpeg executable within the app to your ffmpeg executable ! Does it work then ?

redblotch83 commented 3 years ago

It says ERROR with ~/file.mp4 : failed to take capture. But it will read 4k files that haven't been transcoded with handbrake.

I tested with 1 specific folder containing all encodes and the 4k's it won't read, but the 1080ps it will.

theophanemayaud commented 3 years ago

It says ERROR with ~/file.mp4 : failed to take capture. But it will read 4k files that haven't been transcoded with handbrake.

Ok great, so it is probably a h265 specific issue then :) Try to substitute your version as said, it will hopefully work ! And I'll just have to include h265 codecs in my build of ffmpeg 😅

theophanemayaud commented 3 years ago

As of the latest release, the ffmpeg executable is in the app Content/macOS folder, right click "open app folder" on the app, then content then macOS.

redblotch83 commented 3 years ago

As of the latest release, the ffmpeg executable is in the app Content/macOS folder, right click "open app folder" on the app, then content then macOS.

Sorry, I'm a noob and can't seem to find the FFmpeg that Handbrake uses. I had a copy that I downloaded recently and replaced it in the package contents and issue still occurs. It's definitely an issue on my end so I wouldn't worry about changing the whole app just for this. Thought there might be a log I could look at to see why it is failing to capture.

I did a test and it will read 4k files that have not been encoded. So it has to be something to do with how Handbrake packages the encode.

It will read some 4k h265 files. SO like I said. It has to be an issue with the handbrake encode. It's just some of them for some reason.

theophanemayaud commented 3 years ago

Ok thanks then, I'll try to dig into it a bit more. Are these 4k files already h265 ? I mean before handbrake ? No not yet, there's no log. I though about it but for now just reported the error in the main window, and nothing else. I might have to add an option for logging stuff, to help with these scenarios.

redblotch83 commented 3 years ago

Ok thanks then, I'll try to dig into it a bit more. Are these 4k files already h265 ? I mean before handbrake ? No not yet, there's no log. I though about it but for now just reported the error in the main window, and nothing else. I might have to add an option for logging stuff, to help with these scenarios.

Many Thanks! They were all originally h264 files.

Like I said, it must be something on my side. It might be specific with 60fps files, I'm not quite sure though. It will read without error a folder with 400+ video files that are 2160p h265 24fps. But snags up on a folder of 140 60fps 4k h265 files.

theophanemayaud commented 3 years ago

Ah hmmm then ok, we'll see when I implement a more detailed log option what comes up. Or if I find out this specific problem earlier !

redblotch83 commented 3 years ago

Ah hmmm then ok, we'll see when I implement a more detailed log option what comes up. Or if I find out this specific problem earlier !

Sorry I can't be of more assistance! (being a code noob and all)

redblotch83 commented 3 years ago

FYI. I downloaded the update from the Mac app store and this problem has gone away! Must have been an issue in FFmpeg

theophanemayaud commented 3 years ago

Awesome ! I did spend some time, while porting to the library, fixing weird things that had been inherent to the executable, so it's great I didn't mess it up and even improved :D Thanks for the feedback ! closed by #13