# Output game frames to file

**URL:** <https://forums.unrealengine.com/t/output-game-frames-to-file/337266>\
**Category:** Blueprint\
**Tags:** UE4-9, unreal-engine, CPP, Blueprint, question\
**Created:** [November 2, 2015, 11:11pm UTC](https://forums.unrealengine.com/t/output-game-frames-to-file/337266 "2015-11-02T23:11:45Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_69b87708](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_69b87708](https://forums.unrealengine.com/u/anonymous_user_69b87708)\
**Post date:** [November 2, 2015, 11:11pm UTC](https://forums.unrealengine.com/t/output-game-frames-to-file/337266/1 "2015-11-02T23:11:45Z")

</div>

**This applies to Unreal Engine 4.9**

Each frame, I’d like to save it to file (overwriting the existing one).

For a simple D3D11 demo that I have made, I’ve been able to do this with:

```
void Engine::CaptureFrame(D3DX11_IMAGE_FILE_FORMAT format, const LPCTSTR fileName){

	backbuffer->GetResource(&resource);
	ID3D11Texture2D* texture;
	HRESULT hResult = resource->QueryInterface(__uuidof(ID3D11Texture2D), reinterpret_cast<LPVOID*>(&texture));
	D3DX11SaveTextureToFile(deviceContext, texture, format, fileName);

	//Clean up
	texture->Release();
	resource->Release();
}

```

I have done this with OpenGL, too, using a library called “[FreeImage](http://freeimage.sourceforge.net/)”.

I don’t want to modify UE4 source and am looking for a way to “hook” into UE4 and “capture” the frame.

I’ve managed to do this with [Open Broadcasting Software](https://obsproject.com/), but I’d like to do this natively, within UE4, either via c++ or blueprints.

How can I go about this? Is it even possible?
