Search code examples
videoffmpegwindows-10video-processing

Getting time codes in video files easier


I am going through some videos to trim them (extracting parts of the video).

I know there is billions of software out there that can trim videos easily, but I haven't found any that does not recode the result.

My method right now is to open the video in MPC-BE -> play -> pause -> note down the time -> resume to find a place end the clip -> pause -> note down the end time for the clip. Then I take the time codes and use ffmpeg to extract the part. Usually with something like:

ffmpeg -i input.mp4 -ss 01:50:00 -to 01:55:00 -c:v copy -c:a copy output.mp4

My question is is there an easier way to get the time codes? The best thing would be to use ffplay to playback and just hit a key-combo to copy the time code. But I am also open any other approach that will make it easier to get the timecodes. As you probably understand, writing down the time codes manually for 23 clips is a real pain.


Solution

  • mpv

    The player mpv support scripts for custom functionality that is not part of the core player. There are several user scripts available that involve cutting/trimming that may be helpful:

    • copyTime - Get the current time of the video and copy it to the clipboard with the format HH:MM:SS.MS.
    • trim.lua - Create a trim of video files without transcoding. Utilizes ffprobe to fetch accurate keyframes.
    • splice - Create a video out of cuts made in the current playing video.
    • mpv_slicing_copying - A fork from mpv_slicing. It will cut fragments of the video in original format instead of RGB.
    • excerpt - Allows you to quickly create excerpts from media files, you just have to set begin and end markers.

    LosslessCut

    LosslessCut is a GUI to ffmpeg for lossless trimming and cutting of video and audio files.

    losslesscut screenshot