bartekmotyl / simple-video-cutter

Windows-based tool for efficient browsing and cutting video footage
MIT License
317 stars 42 forks source link

Long Video doesnt show up fully #63

Closed Maaster closed 2 years ago

Maaster commented 2 years ago

Hello, I have a 46GB Video (mp4) that is over 37hours long. When I load it into Simple Video Cutter, only around 11 hours are loaded in.

Anything Im doing wrong here? Shorter Videos do load well.

Due to the size of it I cannot easily upload the file, but it is a Twitch VoD. Is there an alternative for me to split it easily/fast beforehand into smaller parts?

Thanks!

bartekmotyl commented 2 years ago

Hi, thanks for reporting.

can you please try to load the file to VLC (https://www.videolan.org/vlc/) ? Under the hood, Simple Video Cutter uses VLC, so if VLC is not able to load it, then unfortunately Simple Video Cutter will not be able to load it either. I believe this may be caused by memory limitations - what is your operating system memory?

Is there an alternative for me to split it easily/fast beforehand into smaller parts?

You can try to manually split the file using ffprobe and ffmpeg on command line. For such a huge file I would recommend lossless splitting on key frames (see here for more details). To get key frames, you can use the following command (output will be written to keyframes.txt), which btw. may take some time:

<ffmpeg directory>\bin\ffprobe.exe -select_streams v -skip_frame nokey -show_frames -show_entries frame=pkt_pts_time,pict_type,pts_time C:\path\to\your\video.mp4 >keyframes.txt

Then, basing on key frames, you can split the original file into smaller chunks (on key frame boundaries):

<ffmpeg directory>\bin\ffmpeg.exe  -ss <start-time>  -i "input.mp4"  -codec copy -copyts -avoid_negative_ts make_zero -to <end-time> -map 0:v -map 0:a?  part-1.mp4 

<start-time> and <end-time> are specified in fractional seconds e.g. 23.500, 145.560 etc.

Maaster commented 2 years ago

Interesting. You are correct, VLC also "only" loads 10h49m. MPC-BE can load it fully.

I have 16GB RAM (Win10 64bit).

ffprobe also tells me 10h49m as Input#0.

I tried to throw the file into Premiere Pro and it tells me it cant open the file due to an error in the header. So Im guessing this might be an error on my end and MPC-BE just ignored them all? I am re-downloading the file (fyi, its a Twitch Stream, hence the length), it might be corrupted or the likes since I downloaded it while the stream was still running. If that one works fine, Im sorry and will close the issue :)

bartekmotyl commented 2 years ago

Please share you experience here. I am really curious whether Simple Video Cutter would be able to handle such big video file correctly.

Maaster commented 2 years ago

Alright, redownloaded it (its now even bigger at 56GB, 48hours) - VLC also loads and plays it well, SimpleVideoCutter doesnt, sadly. It cuts off at 24hours. Seems to be exact? Doesnt seem to be incidental.

bartekmotyl commented 2 years ago

Thanks for information. Indeed, I made have made an assumption somewhere that duration of a video file is 'Time' i.e. will fit into 24 hours. Will check that and correct if possible.

bartekmotyl commented 2 years ago

For testing purposes I have downloaded a video from YT ("48 hours timer"), which in worst quality is not even that big - ca 350 MB. What is important, it indeed has 48 hours. I tested that video file and it seems that Simple Video Cutter in principle works (the whole video file is loaded and accessible) but the problem is that all time positions (on the timeline) are presented in hh:mm:ss format which "wraps" to 00:00:00 on 24-hours boundaries.

bartekmotyl commented 2 years ago

Fixed in development branch, will be included in release 0.25