Idea - Darkplaces support for playing video files on brushes

Developer discussion of experimental fixes, changes, and improvements.

Moderators: Nexuiz Moderators, Moderators

Idea - Darkplaces support for playing video files on brushes

Postby MirceaKitsune » Tue Dec 09, 2008 1:20 pm

This idea has been poking me for a few days now so I thought it could be interesting to bring it up here. What if there would be support in the Darkplaces engine to be able to play avi and mpg files (and other similar formats maybe, even just quicktime videos) in a map on a screen or other surfaces?

This is my idea: Every such video would consist of the video file itself in avi, mpg, wmv or whichever format, and a new special / common texture for gtkRadiant, probably called video or something else. There would be a videos folder under data in which the video files would be put in. Then when mapping in gtkRadiant, you'd normally make a brush and on every side of it that you want the video to play on, put this special common texture for playing video and in-game that side would act like a screen and have the video file showing on it. Another phase however would require a brush transformation in Radian, so the brush can be transformed into a screen (just like you have to transform a brush into a mover for doors and elevators), so that in its entities you can specify the address to the video file and possibly other properties like brightness, colors, and if you want the video's sound to play and at what volume as keys.

Regarding sound, the video file's sound if it has any (if specified that wanted to play under the brush's entities) would just be played in the center of the brush you transformed into a screen. In-game the video would loop, or if that could be a good idea it could be triggered somehow as well if you set it to a trigger in-game.

I believe this could be an interesting thing because it could make maps very pretty and be an interesting feature. Imagine making an arena and having large screens around it showing other combat scenes from that map. Also such a technology could be used to make small videos of unique texture effects and have them around rooms. For example, considering that such videos would be playable as a skybox texture, one could put a video with battleships fighting in space as a skybox, and in a map like Starship or Soylent Space when you'd look out you'd see the planets spinning, ships fighting, exploding, etc.

Just an idea but what do you think, good or bad? Could it be given a shot in DP sometime? Also please don't take my idea the wrong way, I know this isn't something easy to make either and am not demanding that the devs do the impossible now. I know this is open source, that it brings no money and that development possibilities are limited, but this is just an idea which could be pretty nice in case it is easy enough to make and anyone feels like trying it :)
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby divVerent » Tue Dec 09, 2008 1:35 pm

It'd get overused fast, leading to very huge CPU consumption for most people.

Also, none of the formats you mentioned can be implemented. Part of DP development is in a very oppressive country where it is not allowed to support these formats in free software, and these developers would have to fear lawsuits for software patent violations all the time (I was talking about the USA). The only possible format would be OggTheora, but seriously - who even knows how to ENCODE to that? It's basically yet another "weird format that nobody uses".
Last edited by divVerent on Tue Dec 09, 2008 1:38 pm, edited 1 time in total.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby ai » Tue Dec 09, 2008 1:36 pm

I don't believe such a thing will ever be possible. For one, video sizes would be included in the map, and for two, it would not be possible codec wise. Both as how they work and that many codecs wouldn't be compatible with GPL.
ai
Forum addon
 
Posts: 2131
Joined: Sun Mar 05, 2006 3:54 pm
Location: Behind you

Postby divVerent » Tue Dec 09, 2008 1:41 pm

Video sizes included in the map is no issue. And we COULD use a single viable video format - OggTheora.

But as long as nobody uses that format except for some weirdos, we can't expect good (and usable, even for Windows and Mac users) encoding tools for it to appear.

Even all the pirates encode in MPG or AVI, or possibly OGM and MKV, and in all cases with a MPEG based codec for which patent licenses would have to be bought. And movie/anime piracy is basically the only existing motor in development of high quality audio/video codecs today... (not talking about low quality, low bitrate codecs for webcam, or microphones)
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Alien » Tue Dec 09, 2008 1:59 pm

Animated gif (their patent has already expired).

x264 is free and is better than all other h264 implementations.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby MirceaKitsune » Tue Dec 09, 2008 2:04 pm

divVerent wrote:It'd get overused fast, leading to very huge CPU consumption for most people.

Also, none of the formats you mentioned can be implemented. Part of DP development is in a very oppressive country where it is not allowed to support these formats in free software, and these developers would have to fear lawsuits for software patent violations all the time (I was talking about the USA). The only possible format would be OggTheora, but seriously - who even knows how to ENCODE to that? It's basically yet another "weird format that nobody uses".


Hmm... could playing a certain video file on many screens at the same time on the map use the same amount of CPU as for a single video (process just a single video but play it in many places)? There could then be a limit of only 3-4 videos allowed simultaneously on a map to avoid high CPU usage.

And yeah, I was worried of a legal problem especially involving patents. Not sure when the dictatorship in the US and other countries will stop ruining good software. There are converters around though and as far as I know there should still be some video formats that you can use freely in more uncivilized countries and should not be too big in file size either. I was very much thinking the quicktime format... or the .flv format by Adobe which Youtube uses, which is of great quality and highly compressed, although its a pretty uncommon format.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby Alien » Tue Dec 09, 2008 2:08 pm

No way for quicktime cause it is a container and not a codec, same goes to flv.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Postby MirceaKitsune » Tue Dec 09, 2008 2:14 pm

There has to be a safe and usable common video format out there though. As far as I know there is avi, wmv, mpg, mp4, mov, and a few more as well which I may be missing now, so maybe something can work out. I was curious though, if in case a good video format is found which can have have a decoder in the game, how possible it would be to make it play on surfaces.
MirceaKitsune
Keyboard killer
 
Posts: 593
Joined: Thu Aug 14, 2008 6:48 am
Location: Romania - Bucharest

Postby divVerent » Tue Dec 09, 2008 2:16 pm

x264? H.264 is based on MPEG-4, and thus covered by patents. x264 is certainly not legal to distribute in the USA.

FLV? A MPEG-4 variant again.

Quicktime? Apple is much more violent against patent violators than the MPEG guys. Also, they either use a MPEG-4 variant (known as "H.264" or "MPEG-4 AVC"), or a Sorenson codec that is heavily protected by patent lawyers.

There is no safe and usable COMMON video format. The only potentially safe and space efficient format is Ogg container, OggVorbis audio, Theora video. I bet most people don't even know which file extension this combination would have... just so you get an idea of how uncommon this is. The extension would be "OGV", by the way.[1]

Anyway, you should by now know why mplayer/ffmpeg development is hosted in Hungary, and not in a so-called "civilized" country like the USA. If the EU take over software patents too, they'll sure go to Russia.

If the same video is played on many surface, it is same CPU usage as if it is on one surface. But mappers would put LOTS of videos in their map, and overuse it that way. Just like they already overuse reflections and put them on the tiniest and most useless surfaces, and we get like 30 reflection planes (or 4 fps, if reflections are enabled).

[1]Not OGM, as OGM is yet another (now deprecated) container format, and commonly used for anime with MPEG-4 video, OggVorbis audio, and subtitles.
1. Open Notepad
2. Paste: ÿþMSMSMS
3. Save
4. Open the file in Notepad again

You can vary the number of "MS", so you can clearly see it's MS which is causing it.
divVerent
Site admin and keyboard killer
 
Posts: 3809
Joined: Thu Mar 02, 2006 4:46 pm
Location: BRLOGENSHFEGLE

Postby Alien » Tue Dec 09, 2008 2:50 pm

Matroska is also totally free.
Alien
Forum addon
 
Posts: 1212
Joined: Tue Apr 22, 2008 7:12 am

Next

Return to Nexuiz - Development

Who is online

Users browsing this forum: No registered users and 1 guest

cron