void OgreOpenVR::startRecording(std::string filename) { if (!m_recording) { ffmpeg_encoder_start(filename.c_str(), AVCodecID::AV_CODEC_ID_MPEG2VIDEO, 25, m_window->getWidth(), m_window->getHeight()); m_recording = true; } }
/* Represents the main loop of an application which generates one frame per loop. */ static void encode_example(const char *filename, int codec_id, int width, int height) { int pts; uint8_t *rgb = NULL; ffmpeg_encoder_start(filename, codec_id, 25, width, height); for (pts = 0; pts < 100; pts++) { frame->pts = pts; common_generate_rgb(width, height, pts, &rgb); ffmpeg_encoder_encode_frame(rgb); } ffmpeg_encoder_finish(); free(rgb); }
static void encode_example(int width, int height, float factor) { char filename[255]; int pts; uint8_t *rgb = NULL; snprintf(filename, 255, "tmp." __FILE__ "_%.2f.h264", factor); ffmpeg_encoder_start(filename, AV_CODEC_ID_H264, 25, width, height, factor); for (pts = 0; pts < 100; pts++) { frame->pts = pts; common_generate_rgb(width, height, pts, &rgb); ffmpeg_encoder_encode_frame(rgb); } ffmpeg_encoder_finish(); free(rgb); }