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 > Video Encoding > MPEG-4 ASP

Reply
 
Thread Tools Search this Thread Display Modes
Old 16th May 2008, 17:26   #1  |  Link
boilerlt1
Registered User
 
Join Date: May 2008
Posts: 6
How can I locate a keyframe in a DivX stream?

Hi guys, major video newbie here.

I'm encoding DivX 3 video using ffdshow, and I'm encapsulating it in Matroska. I'm using mkvmerge, a Matroska utility, to pull the DivX stream out of the container. What I'd like to do is read the stream and locate the keyframes. However, I haven't found any luck finding information on how frames are encoded, other than that DivX 3 is based on Microsoft's MPEG-4 Version 3 codec.

Can anyone offer any tips? I couldn't find much when I searched the board.

Thanks!
boilerlt1 is offline   Reply With Quote
Old 16th May 2008, 17:42   #2  |  Link
setarip_old
Registered User
 
setarip_old's Avatar
 
Join Date: Aug 2005
Posts: 16,274
Hi!

Load the DivX-compressed video into VirtualDub and press the keyframe radiobutton (looks like a key)...
setarip_old is offline   Reply With Quote
Old 16th May 2008, 17:51   #3  |  Link
boilerlt1
Registered User
 
Join Date: May 2008
Posts: 6
setarip_old -- unfortunately, I need to do this programatically, through code. Thanks for the tip though.
boilerlt1 is offline   Reply With Quote
Old 16th May 2008, 18:40   #4  |  Link
unskinnyboy
Registered User
 
unskinnyboy's Avatar
 
Join Date: Feb 2004
Location: NTSC R1
Posts: 2,047
This isn't 1999. Why are you using DivX 3 for encoding?
__________________
unskinnyboy is offline   Reply With Quote
Old 16th May 2008, 19:51   #5  |  Link
boilerlt1
Registered User
 
Join Date: May 2008
Posts: 6
Quote:
Originally Posted by unskinnyboy View Post
This isn't 1999. Why are you using DivX 3 for encoding?
Long story. I'll try to summarize it:

The project is a DirectShow-based program where one process records video to disk. Another process (also DirectShow based) reads that video, while it's still being recorded to disk, and lets you seek around it. You could loosely think of it as a TiVo, but this is actually for monitoring video output from a scientific instrument. The video will be sync'ed with a considerable amount of metadata.

Now that that's out of the way...

The project requirements don't really bind me to using DivX 3, but so far anything newer than version 3 won't let me seek around video while it's still being recorded. EDIT -- if it matters, I've done initial testing with ffdshow, which is GPL'ed, so I can't really use that for production anyways.

On that note, how can I find keyframes in files recorded with newer versions of DivX?

Last edited by boilerlt1; 16th May 2008 at 19:53.
boilerlt1 is offline   Reply With Quote
Old 16th May 2008, 20:05   #6  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,689
Quote:
Originally Posted by boilerlt1 View Post
EDIT -- if it matters, I've done initial testing with ffdshow, which is GPL'ed, so I can't really use that for production anyways.
Isn't DivX 3 the hacked version of DivX using Microsoft's MPEG-4 codec?
Dark Shikari is offline   Reply With Quote
Old 16th May 2008, 20:17   #7  |  Link
boilerlt1
Registered User
 
Join Date: May 2008
Posts: 6
Why, yes it is.
boilerlt1 is offline   Reply With Quote
Old 16th May 2008, 20:35   #8  |  Link
unskinnyboy
Registered User
 
unskinnyboy's Avatar
 
Join Date: Feb 2004
Location: NTSC R1
Posts: 2,047
boilerlt1, I see. Your issue is very specific - seeking on a video while recording it, and you say anything above DivX 3 doesn't allow it? I am surprised. If anything, I'd have expected a newer version of an ASP codec to support this. I suppose you have already tried the latest builds of Xvid & DivX?

Why is ffdshow being GPL'd stopping you? AFAIK, GPL doesn't restrict any production usage (however, if you are using it for a commercial purpose and making money of it, then your program should also be GPL'd).

Now, about the frame list, I don't think you should reinvent the wheel, when there are existing tools which can do this.

Here is one way -
  • Get MPEG4 Modifier CL from here.
  • In your program call it with the following parms:

    Code:
    mmcl --frame-list "C:\path_to_frame_list\frame_list.txt" "C:\path_to_your_video\yourvideo.avi"
  • Now do a:

    Code:
    findstr I-VOP "C:\path_to_frame_list\frame_list.txt">"C:\path_to_frame_list\I-frame_list.txt"
  • Your I-frame_list.txt will be in the following format:

    Code:
         0: I-VOP    (0:00:00.000)
       300: I-VOP    (0:00:12.512)
       600: I-VOP    (0:00:25.025)
       900: I-VOP    (0:00:37.537)
      1200: I-VOP    (0:00:50.050)
      1245: I-VOP    (0:00:51.926)
      1249: I-VOP    (0:00:52.093)
      1266: I-VOP    (0:00:52.802)
      1268: I-VOP    (0:00:52.886)
      1271: I-VOP    (0:00:53.011)
      1273: I-VOP    (0:00:53.094)
      1573: I-VOP    (0:01:05.607)
      1873: I-VOP    (0:01:18.119)
      2173: I-VOP    (0:01:30.632)
      2372: I-VOP    (0:01:38.932)
      2486: I-VOP    (0:01:43.686)
      2671: I-VOP    (0:01:51.402)
      2971: I-VOP    (0:02:03.915)
      3024: I-VOP    (0:02:06.126)
      3221: I-VOP    (0:02:14.342)
      3321: I-VOP    (0:02:18.513)
      3369: I-VOP    (0:02:20.515)
      ....
      ...
      ..
  • I-VOP = I-frame
__________________
unskinnyboy is offline   Reply With Quote
Old 16th May 2008, 20:50   #9  |  Link
boilerlt1
Registered User
 
Join Date: May 2008
Posts: 6
Quote:
Originally Posted by unskinnyboy View Post
Why is ffdshow being GPL'd stopping you? AFAIK, GPL doesn't restrict any production usage (however, if you are using it for a commercial purpose and making money of it, then your program should also be GPL'd).
Correct, this is a paid project. I understand mkvmerge is GPL'ed as well, and ultimately we will avoid using anything that doesn't have a commercial-compatible license. There are some killer GPL-based tools out there... but unfortunately we're not in a position to make this project open-source as well.
boilerlt1 is offline   Reply With Quote
Old 16th May 2008, 21:06   #10  |  Link
Dark Shikari
x264 developer
 
Dark Shikari's Avatar
 
Join Date: Sep 2005
Posts: 8,689
Quote:
Originally Posted by boilerlt1 View Post
Correct, this is a paid project. I understand mkvmerge is GPL'ed as well, and ultimately we will avoid using anything that doesn't have a commercial-compatible license. There are some killer GPL-based tools out there... but unfortunately we're not in a position to make this project open-source as well.
First of all, in that case, you better not use DivX 3; being hacked, its totally illegal and has no commercial use clause whatsoever.

Perhaps you should use ffmpeg, which is available under the far less restrictive LGPL?
Dark Shikari is offline   Reply With Quote
Old 16th May 2008, 22:49   #11  |  Link
Ajax_Undone
I dont care so should you
 
Ajax_Undone's Avatar
 
Join Date: Apr 2006
Location: In hell next to the boiling pit of Lava...
Posts: 989
You know you could hit the Divx guys up on a feature request for the read behind writing ability that divx 3 has...

Probubly not going to happen so If not I would go with ffmpeg...
__________________
My Installer's ||
Ajax_Undone is offline   Reply With Quote
Reply

Tags
divx, keyframes, matroska

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 00:21.


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