Bug 6048 - Video capture results in slightly sped up avi
Status: REOPENED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Video
Version: GIT MASTER
Hardware: PC Windows Vista
: P3 normal
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2013-10-24 23:05 EDT by campagnolo90
Modified: 2014-03-13 13:28:43 EDT
1 user (show)

See Also:



Description campagnolo90 2013-10-24 23:05:31 EDT
When rendering demos to avis using the video command the video is sped up a small amount.

Example:
http://www.youtube.com/watch?v=lh9IUIwIEcU which was rendered from http://demos.igmdb.org/z3ct4d/2nd-Map_Cooller_vs_ZeRo4_ztn3tourney1(ZeRo4).dm_68

The demo is 15 minutes long, the warmup is 0:10 and the ending score screen is 7 seconds

What is expected: the resulting video should be 15:17 long

What occurs: the resulting video is 15:00

Timescale is set to 1, however all videos regardless of a mod being used or not are sped up by about 2 to 2.5% each time.

I'm using motion jpeg output with the video command to render the demos into avis with the following command line:

ioquake3.x86.exe +set net_enabled 0 +set r_fullscreen 0 +set r_mode -1 +set r_customwidth 1920 +set r_customheight 1080 +set s_useOpenAL 0 +set cl_aviFrameRate 30 +set cl_aviMotionJpeg 1 +set cl_aviMotionJpegQuality 100 +demo demo_file +video output_file

I can provide additional samples and/or demos if required.  Other games that are based on ioq3, like iortcw, etlegacy, and openjk also suffer from the same issue.  The only derivative engine I've run into that this doesn't occur on is wolfcamql.

Note: On a related note, the audio in the above movie slowly falls out of sync with the video.  This consistently happens in addition to the above issue, however I am not sure they are related.  The desync is noticeable near the end of the movie; sounds trail the video by about .2 seconds.
Comment 1 campagnolo90 2013-10-24 23:21:15 EDT
Sorry about that, the YouTube link should have been:
http://www.youtube.com/watch?v=0iVxWP3z_UM
Comment 2 campagnolo90 2013-10-25 13:48:37 EDT
ent from jamme gave me this patch that he is using which appears to fix the issue:

http://pastebin.com/K5wX9AnK

Hope this helps.
Comment 3 campagnolo90 2013-10-26 23:36:00 EDT
Here are two diffs:
Fixing the video being too fast:
https://github.com/JACoders/OpenJK/commit/b0d61035c755ae1921291fd23abc5053e0eb4d2c

And the second one fixing the audio desyncing:
https://github.com/JACoders/OpenJK/commit/1520ebb09e32787b965bc6cf733e44d9e109952e
Comment 4 Tim Angus 2013-11-02 15:12:23 EDT
Fixed by 7ae49cc.
Comment 5 campagnolo90 2014-03-13 13:26:14 EDT
The current fix does appear to mostly mitigate this issue, however after some more exhaustive testing the issue still does occur.

Please see https://www.youtube.com/watch?v=yZBwFUvOerw

According to YouTube's video timer, the run starts at 3.041 and the run ends at 1964.1 (total length: 1961.059 seconds).

Defrag's timer says the run is 1960.648 seconds.

The difference between the two times is 0.411.

It is difficult to tell, but based on the above, it appears that the video is sped up by 0.411 seconds which results in the audio and video desynchronizing.  The audio appears to be the correct length.

This issue seems to be exasperated by rendering at higher resolutions.

If you need more information please let me know.
Comment 6 campagnolo90 2014-03-13 13:28:43 EDT
I've set this as reopened since the issue is still present.