Захват видео и аудио
Материал из CryWiki Russia
Alex626 (Обсуждение | вклад) |
Alex626 (Обсуждение | вклад) |
||
Строка 1: | Строка 1: | ||
{{В_процессе_перевода}}<br> | {{В_процессе_перевода}}<br> | ||
- | |||
- | == | + | == Захват видео и аудио == |
- | + | === Обзор === | |
- | + | Это руководство объясняет как правильно настроить редактор (или игру), чтобы записывать видео в виде отдельных кадров и звуковой дорожки ( стерео или 5.1 surround sound) в wav файле. Этот собранный мтериал может быть в дальнейшём объединён в один видео файл с помощью любого видео-редактора. | |
- | + | === Подготовка === | |
- | + | Процесс захвата видео требует ввода нескольких консольных команд вручную, чтобы начать запись обоих медиа потоков. Чтобы ускорить данный процесс, вы можете создать конфиграционные файлы, в которых будут записаны все необходимые команды. Таким образов, вы можете начинать и останавливать щапись довольно быстро, хотя, здесь есть некоторые ограничения, о которых следует знать. | |
- | + | Чтобы начать запись, вам нужно будет настроить несколько вещей. | |
- | ==== Frame size ==== | + | === Настройки видео === |
+ | |||
+ | ==== Frame size ==== | ||
The height and width of the captured frames in the editor is exactly the size of your perspective window. You can easily resize the view size by rescaling the docked windows (like the rollup bar or the console). The size of the frame is displayed in the upper right corner of the perspective window. | The height and width of the captured frames in the editor is exactly the size of your perspective window. You can easily resize the view size by rescaling the docked windows (like the rollup bar or the console). The size of the frame is displayed in the upper right corner of the perspective window. | ||
Строка 20: | Строка 21: | ||
In the actual game you can change the resolution of the captured frames by changing the resolution in the options menu, or using the commands | In the actual game you can change the resolution of the captured frames by changing the resolution in the options menu, or using the commands | ||
- | ==== r_height and r_width ==== | + | ==== r_height and r_width ==== |
We need to set two variables: | We need to set two variables: | ||
Строка 28: | Строка 29: | ||
N stands for the frame height and M for the frame width in pixels. The game will automatically switch to the next possible size if the size entered is not available. | N stands for the frame height and M for the frame width in pixels. The game will automatically switch to the next possible size if the size entered is not available. | ||
- | ==== Frames per second ==== | + | ==== Frames per second ==== |
The captured frames are all full frames, also called progressive frames. | The captured frames are all full frames, also called progressive frames. | ||
Строка 36: | Строка 37: | ||
<br> | <br> | ||
- | ==== Fixed_time_step ==== | + | ==== Fixed_time_step ==== |
To force a fixed frame rate of a certain speed use the command | To force a fixed frame rate of a certain speed use the command | ||
Строка 50: | Строка 51: | ||
<br> | <br> | ||
- | === File format selection === | + | === File format selection === |
The captured pictures can be of in several different file formats. A good choice for average quality is jpeg format, whereas tga or bmp are better for higher quality, and HDR for pictures in high dynamic range quality. | The captured pictures can be of in several different file formats. A good choice for average quality is jpeg format, whereas tga or bmp are better for higher quality, and HDR for pictures in high dynamic range quality. | ||
Строка 56: | Строка 57: | ||
<br> | <br> | ||
- | ==== Capture_file_format ==== | + | ==== Capture_file_format ==== |
Use the console command | Use the console command | ||
Строка 66: | Строка 67: | ||
<br> | <br> | ||
- | ==== File location ==== | + | ==== File location ==== |
The recorded frames will be stored either in the default folder called “CaptureOutput” located in the root folder, or within a custom folder, defined using the following command: | The recorded frames will be stored either in the default folder called “CaptureOutput” located in the root folder, or within a custom folder, defined using the following command: | ||
Строка 78: | Строка 79: | ||
<br> | <br> | ||
- | ==== Starting and ending the recording ==== | + | ==== Starting and ending the recording ==== |
When everything is setup you can start the recording with the command | When everything is setup you can start the recording with the command | ||
Строка 86: | Строка 87: | ||
Set N to 1 to start recording, and 0 to stop. | Set N to 1 to start recording, and 0 to stop. | ||
- | === Audio settings === | + | === Audio settings === |
First of all, decide if you need the audio in stereo or 5.1 surround. You will need to change your audio settings in the Windows control panel. Go to “Sounds and Audio Devices” select the Volume tab, click the button “Advanced” and select your choice of output device. | First of all, decide if you need the audio in stereo or 5.1 surround. You will need to change your audio settings in the Windows control panel. Go to “Sounds and Audio Devices” select the Volume tab, click the button “Advanced” and select your choice of output device. | ||
- | ==== Deactivating the sound system ==== | + | ==== Deactivating the sound system ==== |
After loading your level, you will need to deactivate the sound system before you can redirect the sound output to a file. To deactivate it use the command | After loading your level, you will need to deactivate the sound system before you can redirect the sound output to a file. To deactivate it use the command | ||
Строка 104: | Строка 105: | ||
N should be set to 3 to activate the non-realtime writing of the wav file or 0 to switch it back to the default setting (autodetection). The other settings of this command are not relevant and will be explained in another tutorial. | N should be set to 3 to activate the non-realtime writing of the wav file or 0 to switch it back to the default setting (autodetection). The other settings of this command are not relevant and will be explained in another tutorial. | ||
- | ==== Reactivating the sound system ==== | + | ==== Reactivating the sound system ==== |
To reset the sound system use the following command | To reset the sound system use the following command | ||
Строка 116: | Строка 117: | ||
Note: Although the whole sound system is reset using the above commands, some sounds won’t restart until they are correctly triggered again. This especially applies for looped sounds. To get the correct sounds to play, it is recommended to start the recording of video and sound first, and then enter any area that triggers your looped sounds for your recording. | Note: Although the whole sound system is reset using the above commands, some sounds won’t restart until they are correctly triggered again. This especially applies for looped sounds. To get the correct sounds to play, it is recommended to start the recording of video and sound first, and then enter any area that triggers your looped sounds for your recording. | ||
- | === Creating configuration files === | + | === Creating configuration files === |
To capture several recordings with the same setting, it may be convenient to set up a configuration file containing the parameters required for recording, to ensure all captured files are of the same format. | To capture several recordings with the same setting, it may be convenient to set up a configuration file containing the parameters required for recording, to ensure all captured files are of the same format. | ||
Строка 144: | Строка 145: | ||
Sound.DeactivateAudioDevice() <br> s_OutputConfig 0 <br> Sound.ActivateAudioDevice() <br> | Sound.DeactivateAudioDevice() <br> s_OutputConfig 0 <br> Sound.ActivateAudioDevice() <br> | ||
- | ==== Executing the config files ==== | + | ==== Executing the config files ==== |
To activate the config file open the console and type | To activate the config file open the console and type |
Версия 12:55, 21 мая 2011
Содержание |
Захват видео и аудио
Обзор
Это руководство объясняет как правильно настроить редактор (или игру), чтобы записывать видео в виде отдельных кадров и звуковой дорожки ( стерео или 5.1 surround sound) в wav файле. Этот собранный мтериал может быть в дальнейшём объединён в один видео файл с помощью любого видео-редактора.
Подготовка
Процесс захвата видео требует ввода нескольких консольных команд вручную, чтобы начать запись обоих медиа потоков. Чтобы ускорить данный процесс, вы можете создать конфиграционные файлы, в которых будут записаны все необходимые команды. Таким образов, вы можете начинать и останавливать щапись довольно быстро, хотя, здесь есть некоторые ограничения, о которых следует знать.
Чтобы начать запись, вам нужно будет настроить несколько вещей.
Настройки видео
Frame size
The height and width of the captured frames in the editor is exactly the size of your perspective window. You can easily resize the view size by rescaling the docked windows (like the rollup bar or the console). The size of the frame is displayed in the upper right corner of the perspective window.
In the actual game you can change the resolution of the captured frames by changing the resolution in the options menu, or using the commands
r_height and r_width
We need to set two variables:
r_height N
r_width M
N stands for the frame height and M for the frame width in pixels. The game will automatically switch to the next possible size if the size entered is not available.
Frames per second
The captured frames are all full frames, also called progressive frames.
Define the amount of frames per second you need. A NTSC standard video is approximately 30 frames per seconds, which is a good compromise between quality and file size. A high quality video can have up to 60 frames per second – the difference in quality of higher values is barely noticeable, but will still take up a lot of file space. Motion will not look smooth with less than 24 fps (cinema standard).
Fixed_time_step
To force a fixed frame rate of a certain speed use the command
Fixed_time_step N
Where N specifies time step, which is calculated as follows:
time step = 1 second / amount of frames
Example: 1 second / 30 frames = 0.033333333
0.0166666667 would be 60 frames per second. If you want to record a standard PAL speed video (25 fps), use a value of 0.04.
File format selection
The captured pictures can be of in several different file formats. A good choice for average quality is jpeg format, whereas tga or bmp are better for higher quality, and HDR for pictures in high dynamic range quality.
Capture_file_format
Use the console command
Capture_file_format N
Where N should be replaced with either jpg, bmp, tga or hdr.
File location
The recorded frames will be stored either in the default folder called “CaptureOutput” located in the root folder, or within a custom folder, defined using the following command:
Capture_folder N
Where N should be replaced with the name of your folder (e.g. scene12_take1 )
Be aware that when you start a recording, the captured frames will be placed in the currently defined folder, overwriting any existing files with the same nameFor each new recording you should either create a new folder or move the existing files to another folder to avoid losing any work.
Starting and ending the recording
When everything is setup you can start the recording with the command
_Capture_frames N_
Set N to 1 to start recording, and 0 to stop.
Audio settings
First of all, decide if you need the audio in stereo or 5.1 surround. You will need to change your audio settings in the Windows control panel. Go to “Sounds and Audio Devices” select the Volume tab, click the button “Advanced” and select your choice of output device.
Deactivating the sound system
After loading your level, you will need to deactivate the sound system before you can redirect the sound output to a file. To deactivate it use the command
Sound.DeactivateAudioDevice()
Now, the sound output will be redirected to root folder and saved as a wav file. The sound will not be running in realtime but linked precisely to the set time step. You won’t hear anything after activating the sound again, as long as you record it.
To write the sound use the command
s_OutputConfig N
N should be set to 3 to activate the non-realtime writing of the wav file or 0 to switch it back to the default setting (autodetection). The other settings of this command are not relevant and will be explained in another tutorial.
Reactivating the sound system
To reset the sound system use the following command
Sound.ActivateAudioDevice()
Now a wav file will be created in the root folder of the game. The file will continue recording until the writing is deactivated with the following combination of commands:
Sound.DeactivateAudioDevice()
s_OutputConfig 0
Sound.ActivateAudioDevice()
Note: Although the whole sound system is reset using the above commands, some sounds won’t restart until they are correctly triggered again. This especially applies for looped sounds. To get the correct sounds to play, it is recommended to start the recording of video and sound first, and then enter any area that triggers your looped sounds for your recording.
Creating configuration files
To capture several recordings with the same setting, it may be convenient to set up a configuration file containing the parameters required for recording, to ensure all captured files are of the same format.
A setting config file could look like this:
sys_spec = 4
Fixed_time_step 0.0333333333
Capture_file_format jpg
Capture_folder myrecording
r_width 1280 r_height 800
The command sys_spec = 4 sets the game graphic settings to very high to get the bet look possible.
To speed up the process to start and stop the recording it’s convenient to create two configuration files, one to start and one to stop the video.
To start recording, you need a config file that looks something like this:
Sound.DeactivateAudioDevice()
s_OutputConfig]] 3
Sound.ActivateAudioDevice()
Capture_frames 1
To stop recording, you need a config file that looks something like this:
Capture_frames 0
Sound.DeactivateAudioDevice()
s_OutputConfig 0
Sound.ActivateAudioDevice()
Executing the config files
To activate the config file open the console and type
_Exec N_
while N is the name of the config file.