Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 13th August 2018, 10:06   #1  |  Link
zn
Registered User
 
Join Date: Jan 2009
Posts: 88
mkv - real duration of incomplete file

I want to be able to find duration of unfinished/incomplete mkv file. this shows wrong time:
ffmpeg -i incomplete.mkv
mkvinfo incomplete.mkv
mediainfo --Full --Language=raw incomplete.mkv

I found slow solution to find real duration (takes 3 minutes on 20 GB mkv on SSD):
mkvinfo -v incomplete.mkv (long output, long runtime)
mkvinfo -v incomplete.mkv | tail (short output, 3 minutes runtime)
Code:
| + Simple block: track number 1, 1 frame(s), timestamp 01:12:44.526000000
|  + Frame with size 104544
| + Simple block: key, track number 2, 1 frame(s), timestamp 01:12:44.457000000
|  + Frame with size 366
| + Simple block: track number 1, 1 frame(s), timestamp 01:12:44.485000000
|  + Frame with size 97446
| + Simple block: key, track number 2, 1 frame(s), timestamp 01:12:44.478000000
|  + Frame with size 350
| + Simple block: track number 1, 1 frame(s), timestamp 01:12:44.505000000
|  + Frame with size 79780
May be there is a faster way to find timestamps of last frames in mkv?

I have tried to join first and last 1mb of mkv file, but mkvinfo cannot recognize timestamps after split:
head -c 1000000 incomplete.mkv > 1.mkv
tail -c 1000000 incomplete.mkv > 2.mkv
cat 1.mkv 2.mkv>3.mkv
mkvinfo -v 2.mkv
mkvinfo -v 3.mkv
Code:
| + Simple block: track number 1, 1 frame(s), timestamp 00:00:00.188000000
|  + Frame with size 39003
| + Simple block: key, track number 2, 1 frame(s), timestamp 00:00:00.205000000
|  + Frame with size 320
| + Simple block: track number 1, 1 frame(s), timestamp 00:00:00.229000000
|  + Frame with size 40589
| + (Unknown element: DummyElement; ID: 0x1d21c1e6 size: 103)
| + (Unknown element: DummyElement; ID: 0x1f577efb size: 117)
| + (Unknown element: DummyElement; ID: 0x7a32 size: 19)
| + (Known element, but invalid at this position: Frame number; ID: 0xcd size: 18)
| + (Known element, but invalid at this position: Time slice; ID: 0xe8 size: 28)
| + (Known element, but invalid at this position: Block additional ID; ID: 0xcb size: 34)
| + (Unknown element: DummyElement; ID: 0x1d826e67 size: 10912)
| + (Unknown element: DummyElement; ID: 0x59f4 size: 1252875)

Last edited by zn; 13th August 2018 at 10:18.
zn is offline   Reply With Quote
Old 16th August 2018, 17:43   #2  |  Link
hubblec4
Matroska find' ich toll
 
Join Date: Apr 2008
Posts: 1,377
Often is the duration of an mkv not proper, for example an audio track is larger then a video track.
My chapterEdtior scans the Clusters to find the last video time stamp. This takes for the first time ever 2-3 min.

MKVToolNix Statistics Tags are the base for MediaInfo's output (duration).
You could try to insert these Stats-Tags, but this will also take 2-3min.

There is no other way possible (atm).
hubblec4 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.