Playing ROQ Video Files: Difference between revisions
m typo |
m →Audio |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
= Examples: A Repeating Video on an In-Game Laptop; and on Your Own Video Surface = | |||
[[Image:Builderlaptop.jpg]] | |||
== Notice == | |||
'''These examples of using videos and GUI resources in TDM are still valid and informative, but new FMs should use one of the more modern video formats, not RoQ.''' | |||
== Preamble == | |||
These examples, and their recommendations and images, are by Drumple circa 2007. This was rewritten for concision by Geep, 2020, with these added preamble notes. The general approach is still valid, but the specific tools (SwitchBlade, VirtualDub, and the older Doom3 Editor) are less viable now. Standalone SwitchBlade is no longer available; its development ended with version 3, at which time it was folded into FFmpeg [https://wiki.multimedia.cx/index.php/RoQ RoQ]. TDM now uses a FFmpeg subset for video decoding, including RoQ. | |||
Instead, see two 2015-era OpenArena tutorials by [https://openarena.fandom.com/wiki/RoQ ZaRR]: | |||
* The first uses XMedia Record to preprocess, then FFmpeg to output RoQ | |||
* The second uses Shotcut and XnView to preprocess, then roq.exe, id's official win32 RoQ encoder. The latter is evidently no longer available from id, but the tutorial provides a copy. | |||
Or consider the Overdose-related RoQ-creation tool [https://overdose-game.com/sdk.html ODVideo]. But caution: RoQ tools tuned for other idTech4 games could be TDM-incompatible. | |||
Other 2020-era comments are shown in [square brackets]. | |||
== Introduction to the RoQ Format == | |||
{{Original_Reference|Drumple|3504}} | {{Original_Reference|Drumple|3504}} | ||
The ROQ video file format is one traditionally used id Software, starting with early Doom and continuing (with some tightening of playback format requirements) to Doom3. These latter requirements include: | |||
* a square, powers-of-2 frame format (e.g., 64x64, 128x128, etc.), holding a width compression of the original's standard-definition 4:3 aspect ratio (i.e., width/height = 1.3333) | |||
* 30 frames per second | |||
* separate audio file, e.g., OGG format. | |||
== Programs to Create a ROQ File == | |||
Among possible programs to make ROQ files [Riot], some, such as Quake Video Maker (QVM), fail for our purposes because they cannot handle square videos. SwitchBlade 3.12 works well, paired with preprocessing by VirtualDub. | |||
== Preprocessing an AVI with VirtualDub == | |||
SwitchBlade 3.12 will expect an AVI to have following input format: | |||
* a square powers-of-2 format. 512x512 is recommended for Doom3 cinematics | |||
* image width compression from a 1.3333:1 [i.e., 4:3] aspect ratio | |||
* 30 fps | |||
* Typically no audio. | |||
Use VirtualDub to achieve these. From SwitchBlade documentation, some considerations: | |||
=== Audio === | |||
Audio can be included in the ROQ, but Doom3 evidently ignores it. [Unknown if this is still necessarily true in TDM 2.06+] In the GUIs that use video and audio, the audio is triggered to play from a separate OGG or audio source at the same time the video is started. But if you want to make a ROQ with audio, the source audio must be 22050 Hz, or it will be resampled to that. More typically, in VirtualDub: | |||
* | * Export the original AVI's audio track as a WAV file. Later, use your favorite audio software to make it an OGG. | ||
* While preparing to create the ROQ video, select NO AUDIO from the VirtualDub Audio tab. | |||
* | |||
=== Video === | |||
* The 512x512 ROQ video format was used by id in Doom3 for the id logo and some cinematic scenes, such as where you get rescued in the last scene. So those dimensions should generally suffice. | |||
* Video source dimensions should be at a power of 4:3. So if need be, adjust the video source with VirtualDub (as discussed in the SwitchBlade documentation). | |||
* Optionally, choose an overall quality compression you want from the compression tab. (Drumple prefers no compression, which makes huge AVI files but has the best image quality.) | |||
* As needed, use any other VirtualDub filters to improve the quality of the AVI. | |||
* Finally, save as AVI. | |||
== Converting AVI to ROQ with SwitchBlade == | |||
Just drag and drop the foregoing preprocessed AVI onto the DropROQ.exe from the switchblade folder... sit back and let it make your ROQ video. | |||
== Viewing the Results in a Standalone Player == | |||
* Switchblade 3.12 has no ROQ player to see the final product, but SwitchBlade2 (available from the same site) does. | |||
* If you have it, Media Player Classic can play most ROQ videos. | |||
== Testing the Video and Audio In-Game == | |||
=== On an In-Game Laptop Screen === | |||
There are different ways to implement a new ROQ video in-game. Here, we'll use a moveable_laptop, since it has a common/gui surface in the model already, right in front of the screen area. | |||
First, put the ROQ video (myroqtest.roq) and the OGG sound (myroqtest.ogg) into your game's directory, for example, within a folder called /video. | |||
Create a material shader [e.g., within some .mtr file in your materials folder]: | |||
video/myroq | video/myroq | ||
Line 46: | Line 84: | ||
} | } | ||
Next, we want a GUI that will - | |||
* wait 8 seconds, then play the video [assumed to be no more than 8 seconds long] | |||
* replay it every 8 seconds after that. | |||
So create a file named myguitest.gui, placed in the /guis folder, with content: | |||
windowDef Desktop | windowDef Desktop | ||
Line 64: | Line 105: | ||
rect 0,0,640,480 | rect 0,0,640,480 | ||
visible 1 | visible 1 | ||
background "video/myroq" // | background "video/myroq" // ROQ shader defined in the material file | ||
matcolor 1,1,1,1 | matcolor 1,1,1,1 | ||
onTime 8000 | onTime 8000 | ||
Line 76: | Line 117: | ||
} | } | ||
Then open up the Doom3 editor [or Dark Radiant these days] and the map that you want to test in, and add a moveable_laptop from the menu... | |||
[[Image:Roq_moveselect.jpg]] | [[Image:Roq_moveselect.jpg]] | ||
Add a key/value [i.e., spawnarg] of gui '''/guis/myguitest.gui''' to it, for the GUI we just made. | |||
[[Image:Roq myguitest.jpg]] | [[Image:Roq myguitest.jpg]] | ||
Save and try it out. See the first screenshot above. | |||
=== Alternative: On Your Own Video Surface === | |||
fit the | To make a video surface: | ||
* Make a brush and convert it to a func_static. | |||
* Add the gui key/vals, as above. | |||
* Select one face - where your video will play - and apply the common/entitygui to it [giving Figure A below]. | |||
* Make sure you fit that image to your selected face [e.g., in the DR Texture editor, resulting in Figure B], otherwise the video will play in a corner of the selected face. | |||
[[Image:Roq_resize.jpg]] | [[Image:Roq_resize.jpg]] | ||
== RoQ References == | |||
[[ | '''VirtualDub'''. Development of this ceased at the end of 2013, and its forum expired in 2015, but (as of Feb. 2020) the last stable version is still available for download at [http://www.virtualdub.org VirtualDub]. | ||
'''Quake Video Maker (QVM) - Easy ROQ creator'''. Historic URL, no longer valid: www.swift-tools.net/Quake/QVM/ . QVM is still available from 3rd-party sites. | |||
'''Switchblade Video Encoder/RoQ Converter'''. Last reported version was 3 [http://planetdoom.gamespy.com/pagetools/pagetools1b7e.html?act=printnews&id=785 says planetdoom], pointing to Riot's homepage. No longer. | |||
[http://www.doom3world.org/phpbb2/viewtopic.php?t=3533 Doom3world Discussion] | |||
[http://www.modwiki.net/wiki/ROQ_%28file_format%29 Modwiki ROQ] | |||
[Riot] At one time there was a list of ROC-creation programs at [http://www.icculus.org/homepages/riot/ Riot's House of Stuff]. | |||
'''RoQ''' Brief history and tech overview at [https://wiki.multimedia.cx/index.php/RoQ RoQ]. | |||
'''RoQ Encoder''' Official Encoder (win32): [ftp://ftp.idsoftware.com/idstuff/quake3/tools/roq.zip idsoftware ftp] | |||
For an alternative take on using QVM to create ROQ files, see [https://www.moddb.com/tutorials/how-to-create-a-roq-video-file1 How to create a RoQ video-file] | |||
{{tutorial-editing}} | {{tutorial-editing}} | ||
[[Category:Video and cutscenes]] | [[Category:Video and cutscenes]] |
Latest revision as of 19:32, 16 March 2020
Examples: A Repeating Video on an In-Game Laptop; and on Your Own Video Surface
Notice
These examples of using videos and GUI resources in TDM are still valid and informative, but new FMs should use one of the more modern video formats, not RoQ.
Preamble
These examples, and their recommendations and images, are by Drumple circa 2007. This was rewritten for concision by Geep, 2020, with these added preamble notes. The general approach is still valid, but the specific tools (SwitchBlade, VirtualDub, and the older Doom3 Editor) are less viable now. Standalone SwitchBlade is no longer available; its development ended with version 3, at which time it was folded into FFmpeg RoQ. TDM now uses a FFmpeg subset for video decoding, including RoQ.
Instead, see two 2015-era OpenArena tutorials by ZaRR:
- The first uses XMedia Record to preprocess, then FFmpeg to output RoQ
- The second uses Shotcut and XnView to preprocess, then roq.exe, id's official win32 RoQ encoder. The latter is evidently no longer available from id, but the tutorial provides a copy.
Or consider the Overdose-related RoQ-creation tool ODVideo. But caution: RoQ tools tuned for other idTech4 games could be TDM-incompatible.
Other 2020-era comments are shown in [square brackets].
Introduction to the RoQ Format
Originally written by Drumple on http://forums.thedarkmod.com/topic/3504
The ROQ video file format is one traditionally used id Software, starting with early Doom and continuing (with some tightening of playback format requirements) to Doom3. These latter requirements include:
- a square, powers-of-2 frame format (e.g., 64x64, 128x128, etc.), holding a width compression of the original's standard-definition 4:3 aspect ratio (i.e., width/height = 1.3333)
- 30 frames per second
- separate audio file, e.g., OGG format.
Programs to Create a ROQ File
Among possible programs to make ROQ files [Riot], some, such as Quake Video Maker (QVM), fail for our purposes because they cannot handle square videos. SwitchBlade 3.12 works well, paired with preprocessing by VirtualDub.
Preprocessing an AVI with VirtualDub
SwitchBlade 3.12 will expect an AVI to have following input format:
- a square powers-of-2 format. 512x512 is recommended for Doom3 cinematics
- image width compression from a 1.3333:1 [i.e., 4:3] aspect ratio
- 30 fps
- Typically no audio.
Use VirtualDub to achieve these. From SwitchBlade documentation, some considerations:
Audio
Audio can be included in the ROQ, but Doom3 evidently ignores it. [Unknown if this is still necessarily true in TDM 2.06+] In the GUIs that use video and audio, the audio is triggered to play from a separate OGG or audio source at the same time the video is started. But if you want to make a ROQ with audio, the source audio must be 22050 Hz, or it will be resampled to that. More typically, in VirtualDub:
- Export the original AVI's audio track as a WAV file. Later, use your favorite audio software to make it an OGG.
- While preparing to create the ROQ video, select NO AUDIO from the VirtualDub Audio tab.
Video
- The 512x512 ROQ video format was used by id in Doom3 for the id logo and some cinematic scenes, such as where you get rescued in the last scene. So those dimensions should generally suffice.
- Video source dimensions should be at a power of 4:3. So if need be, adjust the video source with VirtualDub (as discussed in the SwitchBlade documentation).
- Optionally, choose an overall quality compression you want from the compression tab. (Drumple prefers no compression, which makes huge AVI files but has the best image quality.)
- As needed, use any other VirtualDub filters to improve the quality of the AVI.
- Finally, save as AVI.
Converting AVI to ROQ with SwitchBlade
Just drag and drop the foregoing preprocessed AVI onto the DropROQ.exe from the switchblade folder... sit back and let it make your ROQ video.
Viewing the Results in a Standalone Player
- Switchblade 3.12 has no ROQ player to see the final product, but SwitchBlade2 (available from the same site) does.
- If you have it, Media Player Classic can play most ROQ videos.
Testing the Video and Audio In-Game
On an In-Game Laptop Screen
There are different ways to implement a new ROQ video in-game. Here, we'll use a moveable_laptop, since it has a common/gui surface in the model already, right in front of the screen area.
First, put the ROQ video (myroqtest.roq) and the OGG sound (myroqtest.ogg) into your game's directory, for example, within a folder called /video.
Create a material shader [e.g., within some .mtr file in your materials folder]:
video/myroq { translucent { videomap "video/myroqtest.roq" linear } }
Next, we want a GUI that will -
- wait 8 seconds, then play the video [assumed to be no more than 8 seconds long]
- replay it every 8 seconds after that.
So create a file named myguitest.gui, placed in the /guis folder, with content:
windowDef Desktop { rect 0 ,0 ,640 ,480 backcolor 0, 0, 0, 1 matcolor 0, 0, 0, 1 background "guis/assets/common/bg" windowDef VidFrame { rect 0,0,640,480 visible 1 backcolor 1, 1, 1, 0 windowDef RoqFile { rect 0,0,640,480 visible 1 background "video/myroq" // ROQ shader defined in the material file matcolor 1,1,1,1 onTime 8000 { resetCinematics; resetTime "Anim" "0"; localsound "video/myroqtest.ogg"; // sound file to accompany the video } } } }
Then open up the Doom3 editor [or Dark Radiant these days] and the map that you want to test in, and add a moveable_laptop from the menu...
Add a key/value [i.e., spawnarg] of gui /guis/myguitest.gui to it, for the GUI we just made.
Save and try it out. See the first screenshot above.
Alternative: On Your Own Video Surface
To make a video surface:
- Make a brush and convert it to a func_static.
- Add the gui key/vals, as above.
- Select one face - where your video will play - and apply the common/entitygui to it [giving Figure A below].
- Make sure you fit that image to your selected face [e.g., in the DR Texture editor, resulting in Figure B], otherwise the video will play in a corner of the selected face.
RoQ References
VirtualDub. Development of this ceased at the end of 2013, and its forum expired in 2015, but (as of Feb. 2020) the last stable version is still available for download at VirtualDub.
Quake Video Maker (QVM) - Easy ROQ creator. Historic URL, no longer valid: www.swift-tools.net/Quake/QVM/ . QVM is still available from 3rd-party sites.
Switchblade Video Encoder/RoQ Converter. Last reported version was 3 says planetdoom, pointing to Riot's homepage. No longer.
[Riot] At one time there was a list of ROC-creation programs at Riot's House of Stuff.
RoQ Brief history and tech overview at RoQ.
RoQ Encoder Official Encoder (win32): idsoftware ftp
For an alternative take on using QVM to create ROQ files, see How to create a RoQ video-file