12

I need to play MP4 files on my win7 which apart from minutes and seconds, should display the milliseconds.

I currently have GOM, VLC and MPC-HC. (Note that I want to use a regular lightweight video player and not having to load the file in a video editing program such as sony vegas etc).

The closest I could get at is by using MPC-HC, adding a dummy srt (subs) file for the video and enabling the Subresync option (as shown at https://trac.mpc-hc.org/ticket/3700). This shows the desired format of mm:ss.SSS. But creating a dummy srt (which should contain at least 1 subtitle entry in order for the Subresync option to be enabled) is cumbersome.

Is there another solution?

1

3 Answers 3

17

You nearly had it. Media Player Classic (MPC-HC) has this option already build in. Right click on the time stamp at the bottom right and choose High precision

enter image description here

Other Players like VLC, SMPlayer, Mplayer, KMPlayer don't have this option. Despite the fact that KMPlayer has literally a thousand configuration options

But the subtitle workaround works with any player. Here demonstrated for VLC

0
3

Here is the code (in python) to generate the subtitle file for subtitle workaround:

def generateSRTFile(fileName, duration):
    """ 
    Generate SRT (subtitle) file for micro second display in video 

    fileName: "Movie1.srt"
    duration: "00:12:54"

    NOTE: ignored seconds to make the program more simplified
    """
    # get the hours, min, sec from duration
    time_split = duration.split(':')
    hours = int(time_split[0])
    minutes = int(time_split[1])
    seconds = 59 # int(time_split[2])
    millisecs = [x*10 for x in range(0,100)]

    # open a file to write
    f = open(name=fileName, mode='w', buffering=1)

    # iterate to print to file
    blockNo = 1
    for h in range(hours+1):
        for m in range(minutes+1):
            for s in range(seconds+1):
                for ms in millisecs:
                    f.write(subtitle(h, m, s, ms, blockNo))
                    blockNo += 1
    # close the file
    return f.close()

def subtitle(h, m, s, ms, bn):
    """
    Returns the subtitle block for the given parametes
    h: hours, m: minutes, s: seconds, ms: milli seconds, bn: block number
    """
    block = ""
    block += formatToString(bn) + "\n"
    time_line = formatToString(h)+":"+formatToString(m)+":"+formatToString(s)+","
    block += time_line+formatToString(ms, 3) + " --> " + time_line + \
        formatToString(ms+10 if ms!=990 else 999, 3) + "\n"
    block += "time " + time_line + formatToString(ms ,3) + "\n\n"
    return block

def formatToString(num, length=2):
    """
    Format given number to given length. 
    i.e num = 5 and length = 2. Result = "05" 
    """
    # number of digits in num
    digits = len(str(num))

    # mathematical equivalent for finding digits
    #n = num
    #digits = 0
    #if n==0:
        #digits = 1
    #else:
        #while n:
            #n = n/10
            #digits += 1

    # find how much shorter is num than length
    if digits >= length:
        strNum = str(num)
    else:
        diff = length-digits
        strNum = ""
        for i in range(diff):
            strNum += "0"
        strNum += str(num)
    # return
    return strNum

if __name__=="__main__":
    generateSRTFile(fileName='/home/inblueswithu/Downloads/default.srt', duration="00:05:56")
0

A time consuming method to get time in milliseconds at some point in a video file via VLC is to make a fake subtitle file at/around the time in question, then change delay (50 milliseconds) to get frame time to the nearest 50ms.

A sample srt file could look like this:

1
00:00:30,000 --> 02:00:54,567
sup doc?

(to look for a point in video around the 30 second mark to the closest 50 millisecond)

I had an old VSDC Video editor (33MB), which also has a built in seeker, displays frame number & seek times in milliseconds:

1-Total video time & number of frames 
2-Timeline can be toggled to display video in milliseconds or frames
3-seeker
4-toggle switch
5-current position (in milliseconds)

VSDC

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .