Recording all the palyers in the game? video.Record

I havn’t ever used video.Record before because really it ain’t something people use… but I was thinking of a system were people can report a player? and when we type a command in chat it loads up the players replay?


local config = {
	container = "webm",
	video = "vp8",
	audio = "vorbis",
	quality = 50,
	bitrate = 200,
	fps = 30,
	lockfps = 30,
	name = "Test",
	width = 1280,
	height = 720
}

local iVideoWriter = video.Record( config )
iVideoWriter:SetRecordSound( true )

function StartRecording()
	hook.Add( "DrawOverlay", "Record", Record )
end

function StopRecording()
	hook.Remove( "DrawOverlay", "Record" )
	iVideoWriter:Finish()
end

function Record()
	iVideoWriter:AddFrame( FrameTime(), true )
end

Please read all of this before commenting ! :smiley:
All I have found, havn’t edited nothing, does anyone have any ideas how to run this in a DFrame & a command? I know about OnPlayerChat but I don’t know how to record a player, and then type a command to open up the players video log. (Every time they join) I know this is a massive ask, but really all I wan’t to know is how can you record every player and run it in a derma frame?

Thanks - Jacob

video.Record is clientside, which means you’d have to get the target client to record then somehow have them send the video to the server, then have it sent to you. I’m not sure the sending part would be possible since as far as I know the video is recorded straight to a file rather than giving you access to any of the data, it might not even record it to a place you can access it.

I could be wrong but I don’t think it would be possible with just lua, and even then it would probably run into issues with dropping client framerates and taking quite a while to upload depending on what size they come out.

The best solution for this would probably be using demos, but as far as I know SourceTV has been broken in Garrysmod for a long time. Otherwise it would be possible to do stuff like record entire rounds and delete ones after a certain time, or like you said have it record a certain amount of time after someone gets reported.

It’s entirely possible from what I remember. The videos are recorded to the garrysmod/videos directory, where you can read them, break the data into multiple parts and upload it to a webserver thru the HTTP library. I used to force auto recording for demos on clients, then when they were reported, I had their game upload it to my webserver, then to my client for viewing. You could potentially use net messages, but I wouldn’t try. Too much data, you don’t want to involve the game server in that.

The same method should work for video files instead of demos. This a bad idea though because of the performance issues you can cause with video.Record. You can try and see though. Overhead for recording demos is much smaller so I recommend that route.

It works very well by the way. Yeah, they’ll ping spike while their upload bandwidth is maxed out but demos are so small it only takes a minute, tops. In my experience, this system pretty much solved any issues with toxic players in our community. It was the best tool to see how people are when they think nobody is watching, and to resolve RDM complaints and other things.

But in tern you would be giving any access to upload to that server, which could result in a mess.

No only that but if many people constantly report it could cause the client to get frequent frame drops on lower end pc’s

Thanks all the replies, I have read all of them. I have reconsidered to a Death Replay (when you die, you see how they killed you) Like recording every player for the entire round (max players 32 on my server)
so is there a way to setup like a camera infront of the player? and record? and if so, can we work on this? I would love to make a camera that records players per round. Thanks.

[editline]23rd July 2016[/editline]

Thanks

[editline]23rd July 2016[/editline]

Thanks

Sure, if you don’t know what you’re doing. It’s not hard if you set up your system with security in mind. Max file sizes, single-use upload tokens generated by game server when admin requests the upload. Plenty of ways to make sure upload doesn’t get abused.

Oh, I didn’t let the reports trigger the upload. Only admins could do it, and I only permitted it for serious things that would result in a ban.

Well, when it finishes the website says it dumbs the VIDEO I suppose … and says this:

Ends the video recording and dumps it to disk.
How might I play this video? And how do I assign it to a player? Like infront of him.