Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11268
Location: RU
Hi. When i try to use logocombine.bat, mentioned in tutorial, it does nothing with capture.avi itself, as i see, it processes only logo.avi & subtitle.sub. Though, this is not the point. I tried to combine Logo & Capture by VirtualDub, but you know, it tells me that framerates of these 2 files are different a bit. Capture's is about 60.09983... (i guess this is not the end of number, there are infinite numerals after point), but it's shown as 60.100. When i set framerate of my Logo as 60.100, or even 60.09983, VirtualDub continues to tell me, they're different. Right up to this The question is: How to set for Logo the very same framerate as Capture? I believe, there's a command for MEncoder, but i couldn't find it in docs.
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
Player (36)
Joined: 9/11/2004
Posts: 2623
The number I pulled from the fceu source is NTSC: 1008307711/256/65536 = 60.099822938442230224609375 But I also came across an interesting conversation in my IRC logs that seems related to what you're experiencing.
Dec 31 19:49:31 <Bisqwit> ntscnesframe 655171|39375000 s Dec 31 19:49:31 <Bisqwit> palnesframe 66495|3325214 s Dec 31 19:49:31 <Bisqwit> ntscfceuframe (16777216 | 1008307711) s Dec 31 19:49:31 <Bisqwit> palfceuframe (16777216 | 838977920) s Dec 31 19:49:34 <Bisqwit> well, here are the constants. Dec 31 19:52:10 <Ilari> The NES framerate is not that simple number. It varies a bit between different consoles and even with time in the same console. Its also affected a bit by temperature, etc... Dec 31 19:52:47 <Bisqwit> Well, you have to choose _something_ if you aren't going to perform a frame by frame analysis of runtime Dec 31 19:52:48 <Ilari> Those numbers are likely numbers from the specs. Real world values vary a bit from that... Dec 31 19:53:37 <DeHackEd> failing FCEU performing voltage measurements from your power supply to estimate the clock skew, it's probably good enough Dec 31 19:55:50 <Johannes> a logo rendered at 0.99835580952381 fps has a hex equalent of 0262cfdb / 000a037a, while FCEU recordings use 3c198dff / 00ffffff, according to vdub Dec 31 19:55:54 <Johannes> 60* Dec 31 19:56:09 <Johannes> 60.09881389744052 doesn't work either Dec 31 19:57:05 <DeHackEd> .cl 0x3c198dff / 0xffffff Dec 31 19:57:06 <Bisqwit> 1008307711 / 16777215 = 60.09982652067104 Dec 31 19:57:24 <Johannes> *tries* Dec 31 19:58:09 <naohiro19> What's do you mean "EEE"? Dec 31 19:58:34 <Johannes> it doesn't work either Dec 31 19:59:04 <Johannes> a logo rendered at 60.09982652067104 fps has a hex equalent of d390891f / 03852d1e Dec 31 19:59:42 <Ilari> Can't one force those vidoe edit programs to assume diffrerent framerate than one recorded. Its not like it matters in two second segment? Dec 31 20:00:07 <DeHackEd> I'm inclined to agree Dec 31 20:01:49 <Ilari> And if those values are somewhere in the video, hexedit the file to have the correct framerate? Dec 31 20:01:51 <Johannes> the problem is that I can't combine them because they don't share a common framerate. to combine them, I'd have to convert both to the same framerate, which would make the rest of the video run at the wrong framerate Dec 31 20:02:13 <Johannes> unless I can render the logo at the same framerate at fceu Dec 31 20:02:17 <Johannes> which seems impossible Dec 31 20:02:25 <Johannes> as* Dec 31 20:02:44 <Ilari> Johannes`: Is the final result of logo rendering a video file or sequence of still frames? Dec 31 20:02:59 <Johannes> video file Dec 31 20:03:08 <Johannes> with still frames Dec 31 20:03:50 <Ilari> Johannes`: In what format? Perhaps one can hexedit it to be of correct framerate? Dec 31 20:04:09 <Johannes> the problem is that I can't find the correct framerate. Dec 31 20:04:17 <Johannes> VD can render with any framerate Dec 31 20:05:05 <Ilari> Johannes`: What format is the final logo rendering result in? Dec 31 20:05:10 <Ilari> Johannes`: .avi? Dec 31 20:05:11 <Johannes> avi Dec 31 20:05:29 * curtmack (n=curtmack@h120.77.88.75.dynamic.ip.windstream.net) has joined #nesvideos Dec 31 20:05:36 <curtmack> bizarre wine artefact... Dec 31 20:05:42 * AngerFist has quit ("Fist Of Fury, Marshal Hardcore, Game of Death ya, Mental Blood War... Raving Nightmare!") Dec 31 20:06:01 <curtmack> the textbox renderer in Bunny Must Die, when run via Wine, has the curious side effect of vertically flipping the ENTIRE SCREEN Dec 31 20:06:09 <curtmack> but then it draws the text in the normal location Dec 31 20:06:14 <curtmack> which is not where the textbox is anymore Dec 31 20:07:25 * mc_rove has quit () Dec 31 20:12:34 <Ilari> Johannes`: Open both videos in hex editor. Search for those (fractional) frame rate values in both (note, they are probably "flipped" so 3c198dff becomes 'ff 8d 19 3c' (so called little-endian)). They should be in offsets 72 and 76... Dec 31 20:13:29 * Bablo (i=Bablo@55861b5e.adsl.multi.fi) has joined #nesvideos Dec 31 20:15:10 <Johannes> the fceu recording only has zeroes at that location Dec 31 20:15:15 <Johannes> and ff 8d 19 3c isn't found Dec 31 20:17:45 <NesVideoAgent> Post edited by OmnipotentEntity (OT: Code Golf): http://tasvideos.org/forum/p/188028#188028 Dec 31 20:18:14 <Ilari> Johannes`: Maybe paste first 96 bytes (likely 6 hex editor "rows") of both files somewhere so one can take a look... Dec 31 20:18:44 <DeHackEd> ff ff ff is very searchable Dec 31 20:21:28 * Rinn has quit (""Self-Repair's back." 'What? I thought it was broken.' "Self-Repair self-repairs."") Dec 31 20:22:05 <NesVideoAgent> New reply by OmnipotentEntity (OT: Code Golf): http://tasvideos.org/forum/p/188152#188152 Dec 31 20:24:47 <Johannes> http://bildr.no/view/315159 Dec 31 20:26:28 <DeHackEd> line marked with '80:' Dec 31 20:26:32 <DeHackEd> I see it right there Dec 31 20:26:55 <curtmack> I don't know what's worse - the fact that I'm fighting a digitized GIANT CAT, or the fact that I'm LOSING. Dec 31 20:27:58 <DeHackEd> both of them actually Dec 31 20:28:14 <THROBiX> oki Dec 31 20:28:42 <curtmack> to be clear: by "giant" I mean "its paws are roughly 40 times the size of me" Dec 31 20:29:19 <Ilari> Johannes`: So copy bytes at offsets 0x80-0x87 from main video file to logo file (don't forget to take a backup for case anything goes wrong). Dec 31 20:31:22 <NesVideoAgent> New reply by Flygon (WorkB: #2160: HappyLee's NES Super Mario Bros. in 06:51.03): http://tasvideos.org/forum/p/188153#188153 Dec 31 20:32:47 <Johannes> NES' framerate really does vary Dec 31 20:33:18 <Johannes> I cut a minute off the end of the FCEU recording, and now it reports a different framerate Dec 31 20:34:07 <THROBiX> what is ofset 0x80 to 0x87 in a video file? Dec 31 20:34:10 <THROBiX> something in the header? Dec 31 20:34:12 <THROBiX> offset* Dec 31 20:34:33 <Ilari> THROBiX: It appears that AVI file framerate is stored there... Dec 31 20:34:34 <THROBiX> might depend on encoder though, heh Dec 31 20:34:39 <THROBiX> I see Dec 31 20:35:29 * bkDJ has quit (Read error: 110 (Connection timed out)) Dec 31 20:35:33 * bkDJ (i=DJ@41-59.62-81.cust.bluewin.ch) has joined #nesvideos Dec 31 20:35:40 <THROBiX> stored in 7 bytes? :P Dec 31 20:35:49 <arukAdo> happy new year everybody! :) Dec 31 20:35:57 <THROBiX> thank you, I wish you the same :) Dec 31 20:36:27 <Didgeridoodle> happy new year Dec 31 20:36:33 <Johannes> it worked Dec 31 20:36:36 <Ilari> THROBiX: 8, since that range is inclusive... Dec 31 20:36:44 <THROBiX> aah Dec 31 20:36:46 <THROBiX> my fault Dec 31 20:37:30 <THROBiX> 8 bytes is a long long int or something? :P Dec 31 20:37:43 <THROBiX> I don't know these stuff very well :/ Dec 31 20:37:49 <THROBiX> but that seems too much for only a FPS Dec 31 20:37:55 <THROBiX> an* Dec 31 20:38:12 <THROBiX> are* :< Dec 31 20:38:47 <Johannes> nes' fps has lots of decimal Dec 31 20:38:50 <Johannes> s Dec 31 20:38:50 <Ilari> THROBiX: Its two doublewords, one for numerator and one for denumerator. Dec 31 20:39:12 <adiabatty> well, if you have 32 bits, you have 2^32 different numbers--about 4 billion, I'd say Dec 31 20:39:13 <THROBiX> Johannes`: ah Dec 31 20:39:18 <THROBiX> I see Dec 31 20:40:23 <THROBiX> I thought an FPS would be non-decimal based Dec 31 20:40:31 <THROBiX> but the fact that it's not made things clearer Dec 31 20:40:41 <THROBiX> I have a lot to learn =) Dec 31 20:40:57 <ZeXr0> For those who might be interested http://www.archive.org/details/TASVideos_Nes and http://www.archive.org/details/TASVideos_SNES Dec 31 20:41:48 <AnotherGamer> .cc 40 fim in euros Dec 31 20:41:50 <BisqBot> Use .cl instead of .cc Dec 31 20:41:54 <AnotherGamer> .cl 40 fim in euros Dec 31 20:41:55 <BisqBot> 40 Finnish markkas = 6.727516011966226 € Dec 31 20:50:46 <Ilari> Johannes`: If denumerator is 0xFFFFFF, then the number won't actually terminate but enter loop consisting of 240 digits (in base 10)...
Build a man a fire, warm him for a day, Set a man on fire, warm him for the rest of his life.
Site Admin, Skilled player (1236)
Joined: 4/17/2010
Posts: 11268
Location: RU
thanks for this log, it covers right the same question, and hexediting really helps here. so, one must open saved logo.avi, go to line '0x000080' (or '128' in decimal view) and replace first eight numbers by 'ff ff ff 00 ff 8d 19 3c'. They are equal to decimal fraction '60.09983...etc' incidentally, this framerate is provided by my FCEUX 2.1.3 (edit: as well as 2.1.4a. Are there adelikat's docs wich tell FCEUX framerate, put in this address, in hexadecimal?) the original Logo's values in this line differ according to the framerate of saved logo.avi for instance, if you save Logo with 60 fps, you get '01 00 00 00 3c 00 00 00' PS: this path is NOT trivial. maybe there may be another way? (scripts, bats, etc.)
Warning: When making decisions, I try to collect as much data as possible before actually deciding. I try to abstract away and see the principles behind real world events and people's opinions. I try to generalize them and turn into something clear and reusable. I hate depending on unpredictable and having to make lottery guesses. Any problem can be solved by systems thinking and acting.
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
In AviSynth it's quite simple to match framerates...
v1 = AVISource("video1.avi")
v2 = AVISource("video2.avi").AssumeFPS(v1.FrameRate)

# other commands (Overlay, v1+v2, ...)
Btw. NTSC is 60/1.001 fields per second, which becomes frames per second due to the console's video signal. I'd think the emulator would match that framerate?
Emulator Coder, Skilled player (1141)
Joined: 5/1/2010
Posts: 1217
creaothceann wrote:
Btw. NTSC is 60/1.001 fields per second, which becomes frames per second due to the console's video signal. I'd think the emulator would match that framerate?
There are two matchings here: * The emulator needs to match framerate of console (as close as possible) * The console needs to near-match framerate of whatever relevant TV standard (in this case NTSC). The first match should be as exact as possible because it is emulation quality matter. The later match does not have to be exact. real TVs don't require exact rate match, they will sync if frequency is near enough. Too far and sync might be lost. So when watched on real NTSC TV, NES output really does have field rate of sightly over 60fps.
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
Ilari wrote:
There are two matchings here: * The emulator needs to match framerate of console (as close as possible) * The console needs to near-match framerate of whatever relevant TV standard (in this case NTSC). The first match should be as exact as possible because it is emulation quality matter. The later match does not have to be exact. real TVs don't require exact rate match, they will sync if frequency is near enough. Too far and sync might be lost. So when watched on real NTSC TV, NES output really does have field rate of sightly over 60fps.
I thought that PAL TV refresh rates are 50 FPS because the AC current in PAL areas is 50 Hz, and likewise NTCS uses 60 FPS because the AC current in NTSC areas is 60 Hz (after all, TV was invented way before any of this digital stuff, so everything was pretty analog and the timings were taken directly from the AC power input). Consoles need to match the refresh rate of the TV for rather obvious reasons (which is why there were separate PAL and NTSC consoles).
Senior Moderator
Joined: 8/4/2005
Posts: 5770
Location: Away
Ilari is right, though. TVs (and better yet, multisync monitors) don't require exact same timing to sync; in fact, deviations up to 10% off the standard are technically possible. To give you an example, 1996 arcade game Raiden Fighters runs at 54 fps synced at 54 Hz on a regular NTSC arcade monitor connected to a 60 Hz power outlet). It might be that not every TV would handle that without problems, but 58 fps stuff can be handled by pretty much any one of them.
Warp wrote:
Edit: I think I understand now: It's my avatar, isn't it? It makes me look angry.