View Full Version : how to tell framerate of .ASF
halsboss
28th November 2006, 23:53
Hi, I have some small .ASF created by a small chinese brand still camera (megxon) which also snaps small movies @ 320x240 but unknown framerate. The camera manual only says "MEGP4, 320 x 240 up to 30 FPS".
Naturally :) I'd like to attempt putting these on PAL DVD even if quality isnt the best. AVIcodec 1.2.0.110 shows 4:3 320x240 with fps varying for each .ASF from 5.111 to 5.716 ... I'm not sure I trust that as I'd thought they'd all be fixed fps.
Any ideas on
(a) how to tell the real framerate of .ASFs
(b) how to use that info in a script to open the source and resize/convert/clean to PAL DVD (I'd thought motionprotectedfps may be good)
(c) experiences on which of these PAL sizes might be most visually pleasing to convert to - 704x576 352x576 352x288
720k sample .ASF http://rapidshare.com/files/5238312/PIC00729.ASF.html
Edit: started the "ASF / WMV conversion guide" http://www.doom9.org/index.html?/wmv2avi.htm however the "Actual Rate" in the statistics varied all over the place during playback from about 18.9 to 20 hovering just under 20 ... other clips have framerates hovering around the 18 to 19 range ...
PS is there an "easier" choice of share than rapidshare ?
Pookie
29th November 2006, 02:56
This asftopipe application claims the file is 19fps
http://www.boutell.com/asftopipe/
foxyshadis
29th November 2006, 07:39
Can't get a lot out of it, since muxing in directshow only half-worked (usually use mkv2vfr for times), but it seems to be flat 20fps with pretty strong duplicate dropping. That makes sense for a camera phone. Apparently a lot of tools do the dumb "total frames divided by total time" calculation, which is incorrect for anything that isn't CFR.
IanB
29th November 2006, 08:48
ASF (WMV) is a variable frame rate format. In the stream each frame has an associated time in milliseconds when to display this frame, and it is displayed until the time for the next frame occurs. Where a Drop frames would occur in an AVI file in an ASF stream the time of the next frame is just latter than normally expected.
The WMVTIMES.EXE utility :search: will dump these time indexes out from any asf/wmv file to a text file.
The best match for the true original framerate can be found by analysing these time indexes and comparing them to a theoretical set of indexes for each possible true original framerate.
E.g. a high motion true 29.97 fps source with no drop events will have time indexes thus0 33 67 100 133 ... 933 967 1001 1034 1068 ...Similarly a high motion 25 fps source0 40 80 120 160 ... 960 1000 1040 ...And a true 24 fps source0 42 83 125 167 ... 958 1000 1042 ...While a 23.976 fps source will have the 0.1% speed step0 42 83 125 167 ... 958 1001 1043 1084 ...
Now for a typical still camera taking a movie where the flash memory speed result in a 60% drop rate from a 59.94 fps base sampling rate (interlaced NTSC) this pattern would be a bit like this0 50 83 133 167 217 250 300 334 384 417 467 500
551 584 634 667 717 751 801 834 884 918 968 1001 ...The Excel Edit/Fill/Series tool is very usefull for creating the sequences, display with zero decimal places. Then just match the patterns noting how many to skip each time, when you have it right the numbers present will match consistantly + or - 1 value.
This is a lot tedious, but for a given camera you only have to do it once.
When you have the right original base sample rate use DirectShowSource(..., ConvertFPS=TRUE, FPS={rate}). This will give you a CFR stream with the relative timing of each frame correct. With very advanced processing you could even interpolate the original dropped samples.
halsboss
29th November 2006, 09:08
Ah. Thanks.
The clips are heavily "aliased" and I was going to try AAA (if I can find a SangNom.dll to download)
... AAA code snipped since it's at the Oops link below
when I spotted this...
For antialiasing I usually use EEDI2.BicubicResize(Width,Height). It's fairly slow, but faster than that. ...
Don't ever use Sangnom - it's the equivalent of SeparateFields.SelectEven.EEDI2, though its edge interpolation is only as good as TDeint's.
Is that still the latest advice on strong anti-aliasing ?
Edit: Oops just saw http://forum.doom9.org/showthread.php?p=887909&highlight=sangnom#post887909 - AAA is still in fashion.
Edit2: Hmm. just saw http://forum.doom9.org/showthread.php?p=885881#post885881
Sangnom can help with badly deinterlaced sources, as can Eedi2().Spline16Resize(width,height). Eedi2 would be my first choice, both should reduce the aliasing considerably.
foxyshadis
29th November 2006, 09:49
You might notice AAA doubles each axis first (although it would have been faster to just pointresize, no difference), so it uses sangnom in a similar way to how eedi2 works. Personally I don't like its effects compared to eedi2, other people do, but it's not the horrible resolution killer of a simple
TurnLeft().SangNom().TurnRight().SangNom()
Sangnom does help with bad deinterlacing simply because it throws half the fields out and regenerates them. If it's not crap deinterlaced, that comment doesn't apply.
But wow, that was a 100% turn to left field on the topic, maybe you should have started a new one?
IanB
29th November 2006, 10:13
@halsboss,
For your pic00729.wmv file the first frames index is 55ms which we discount as being capture setup time and not part of the pattern, most of the rest of the frames are in 50ms increments except frames 15, 41, 67, 93, 119, 144, 170 where the increment is 49ms. Thus we have a 26 frame primary cycle of 25x50ms + 1x49ms which leads to an average duration of (25*50+1*49)/26 = 1299/26 = 49.9615ms => 20.0154 fps
There is also a seconadary cycle pattern as the 6th cycle only has 25 frames but as this sample only has 7 cycles we can't infer when the next 25 frame break in the cycle will next occur. With a longer sample we could apply the next level of correction to the pattern.
For short clips this analysis will be adequate. If the clip are much longer then it becomes more important to explore secondary and even tertiary patterns to keep the aggregate error less than 200ms at which point audio desync will become noticable.
halsboss
29th November 2006, 10:27
Wow, foxyshadis and IanB, those comments were really helpful and set readers up in understanding how to approach that into the future. All these clips would be circa 10s, max 30s.
Sorry for the turnleft :) A consolation could be that the Q&A are consistent in the context of dealing with clips of this nature (clips from cheap small "still" cameras which just happen to have some motion capture tossed in).
Cheerio
halsboss
29th November 2006, 10:33
Argh,
With the AVS :-
# for short clips ~15s, can get away with fps=20
Directshowsource("e:\MULTIMEDIA\HomePics\2006-11-29-Jess-Bday\PIC00730.asf",convertfps=true,fps=20)
MediaPlayer10 gives no sound, but Vdub 1.1.16 does ...
Chainmax
29th November 2006, 21:40
Ah. Thanks.
The clips are heavily "aliased" and I was going to try AAA (if I can find a SangNom.dll to download)
...
If the clips are heavily aliased, then try the function posted in this thread (http://forum.doom9.org/showthread.php?t=109422), you might get lucky :).
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.