Is Cutscene Video possible via VTF?

Hey All,
I am making a HL2 map with a cutscene rendered in SFM.
I was wondering since you can’t play bink files in the older source engine like in Portal 2, could I do the following?

  1. Render the video to avi.
  2. Turn it into individual frames at 30 fps.
  3. Convert all those pictures into an animated VTF.
  4. Put an env_screenoverlay in the map and call it on the player with the animated VTF.
  5. Play an Ambient Generic with the dialogue, sounds, and music, from the pre-rendered video.
  6. Profit ?

Can the Source Engine handle a map with this?
If this would work, what resolution should I do that would accommodate all screens? (Yes it would look ugly.)


wouldn’t it make a large VTF file (in the 1+ gb range)?

What are you disagreeing with?

[editline]19th September 2015[/editline]


if an animated normal map in VTF format goes to a few gbs when its only a few frames, I can’t imagine what a video would become in VTF.

It is probably just a 30 second cut-scene, but I can do effects to the video that I can’t do rendering in real time.

EDIT: Depening on the resolution and frames is how big it is. I thought maybe 720 x 720 and the default SFM fps which I think is 24.5.

creating a VTF out of a video is super easy, though depending on the resolution, the file size gets to be ENORMOUS

i wouldn’t suggest doing this, not because of the above reason, but because an animated VTF constantly plays even when it’s not visible
this means that if you happen to enable what displays the texture, it could start at any random frame, being completely out of sync with any audio and hammer I/O

i’d suggest assembling the cutscene in hammer itself

I did not know it played in the background.
That is helpful, thank you! I’ll render it in real time I guess.

As said above, the file size would’ve been insane if you wanted it to be decent resolution. Animated VTFs are compressed per frame, not as whole. Just one 1024x1024 DXT1-compressed texture is around 699KB, a 30 second video at 30 fps would’ve been above 614MB.
Another issue is getting the screen size right, as env_screenoverlay always gets stretched over the entire screen.

Doesn’t portal 2 allow you to play .bik video files? It may work in garrysmod still, but I’m not sure.

Nyan Cat will be good with .vmt - a few repetitive video frames. But long movies are unacceptable. My VTFEdit crashing every time, when I’ll compile .vtf file from >100 1024x1024 frames.

that’s not a vtf, it’s a video file

you can run a concommand that plays a bik video file and executes a command after it
i did it in my mod a while back

now if i only could remember the name of it :v:

yeah it’s entirely possible at least with episode two since nightmare house 2 used bik files

running “disconnect;playvideo_exitcommand moviefile map mapfile” will play the movie, then change map
you need two map files though

Sounds promising.
What is the command, because the one you gave is not a valid command.

What engine?
Would this work on HL2 or Portal (both originals)?

[editline]21st September 2015[/editline]

I actually found some helpful stuff on enabling the command.

Problem is, I have never written code for Source one day in my life?
Any tuts?

[editline]21st September 2015[/editline]

EDIT: Just did testing an reading.
I got playvideo to work, and I am impressed.
Now how do I allow hammer to use it.
I am good at coding but suffer from TL;DR.

Can someone explain this

to me like I’m 5?

Thanks ;D

I think you’ll have issues playing it in game. It may just be the L4D2 engine branch, but when fired through hammer or anywhere else besides manually typing it into the console OR the main menu, playvideo crashes the game.