DTV is a library that provides a simple interface for generating video files from a C++ application

Direct to Video (DTV)

Alt text

What does DTV do?

DTV is a library that provides a simple interface for generating video files from a C++ application. It uses FFmpeg which means that it supports the same encoders and performance that you would get from something like OBS. Unlike OBS, however, it is not dependent on the input being delivered in real-time. This means that regardless of the input frequency to DTV, the output will always be at the frame rate that you select.

How do I use it?

Check out the sample application that is provided with DTV. The interface is extremely minimalistic and is comprised of a handful of intuitive functions. The steps to write an entire video look like this:

  1. Start the encoder by calling the encoder.run(...) method. The encoder runs in its own thread and will wait for you to send video frames to it.
  2. Call encoder.newFrame(...) to get a frame from the buffer to write to. This comes in blocking and non-blocking versions. By calling encoder.newFrame(true), DTV will wait for a frame to become available if the encoder is lagging behind the input. Changing the input to false will cause the encoder to return nullptr if a frame is not available to write to. This can be useful if you'd prefer to miss frames over slowing down your application.
  3. Fill the frame with whatever data you like by populating the atg_dtv::Frame::m_rgb array with 8-bit values.
  4. Commit the frame by calling encoder.submitFrame().
  5. Repeat steps 2-4 until you have no frames left to write.
  6. Call encoder.commit() to inform the encoder that the video stream is over.
  7. Call encoder.stop() which will wait until the encoder finishes encoding buffered frames and then for the encoder thread to exit.

How do I build it?

You will need to have FFmpeg development libraries installed on your computer and the directory listed on your PATH. DTV has only been tested on Windows but in principle should build on other platforms. The cmake script that searches for FFmpeg libraries, however, is Windows specific and you'll have to modify cmake/FindFFmpeg.cmake to work for other platforms. (If you do this, please create a pull-request!)

For FFmpeg pre-built binaries, see the OBS installation instructions page.

Build Steps

  1. Make sure you have the latest version of CMake installed
  2. Make sure you have FFmpeg binaries installed (see above)
  3. Clone the repository: git clone https://github.com/ange-yaghi/direct-to-video.git
  4. cd direct-to-video
  5. mkdir build
  6. cd build
  7. cmake ..
  8. cmake --build .
  9. For MSVC users, check the build folder for a generated Visual Studio solution. You can use this solution like any other and will contain the DTV library as well as the demo application in separate projects.
Owner
Similar Resources

Windows graphical interface for yt-dlp, designed as a simple YouTube downloader

Windows graphical interface for yt-dlp, designed as a simple YouTube downloader

ytdlp-interface This is a Windows graphical interface for yt-dlp, that is designed as a simple YouTube downloader. It doesn't download playlists, and

Jun 17, 2022

Vireo is a lightweight and versatile video processing library written in C++11

Overview Vireo is a lightweight and versatile video processing library that powers our video transcoding service, deep learning recognition systems an

Jun 15, 2022

Color composite video code from ESP_8_BIT as an Arduino library

ESP_8_BIT Color Composite Video Out Library Purpose The composite video generation code from ESP_8_BIT extracted and packaged into a standalone Arduin

Jun 14, 2022

theora-player is an embeddable theora video player C++ library based on the libtheora sample. It has no audio support at this moment.

theora-player Description theora-player is an embeddable theora video player C++ library based on the libtheora sample. It has no audio support at thi

Oct 14, 2021

Provides a menu for playing Karaoke videos.

Provides a menu for playing Karaoke videos.

Provides a menu for playing Karaoke videos. Audio input from a microphone is automatically mixed with output from videos. Videos can be paused and scrubbed.

Dec 26, 2021

Open h.265 video codec implementation.

Open h.265 video codec implementation.

libde265 - open h.265 codec implementation libde265 is an open source implementation of the h.265 video codec. It is written from scratch and has a pl

Jun 24, 2022

Olive is a free non-linear video editor for Windows, macOS, and Linux.

Olive is a free non-linear video editor for Windows, macOS, and Linux.

Olive is a free non-linear video editor for Windows, macOS, and Linux.

Jun 15, 2022

Video player for 3ds

Video player for 3ds

Video player for 3DS Patch note v1.0.1 Added allow skip frames option v1.0.0 Initial release Summary Video player for 3DS Performance 256x144(144p)@30

Jun 10, 2022

Plugin for VLC that pauses/plays video on mouse click

Pause Click plugin for VLC VLC plugin that allows you to pause/play a video by clicking on the video image. Can be configured to work nicely with doub

Jun 19, 2022
OpenShot Video Library (libopenshot) is a free, open-source C++ library dedicated to delivering high quality video editing, animation, and playback solutions to the world

OpenShot Video Library (libopenshot) is a free, open-source C++ library dedicated to delivering high quality video editing, animation, and playback solutions to the world

Jun 21, 2022
Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.
Video game library manager with support for wide range of 3rd party libraries and game emulation support, providing one unified interface for your games.

An open source video game library manager and launcher with support for 3rd party libraries like Steam, GOG, Origin, Battle.net and Uplay. Includes game emulation support, providing one unified interface for your games.

Jun 24, 2022
Video stabilization is a software-based approach in real-time to eliminating environmental effects (wind, heavy vehicle etc.) and enhance the visual performance that degrade video streaming quality.
Video stabilization is a software-based approach in real-time to eliminating environmental effects (wind, heavy vehicle etc.) and enhance the visual performance that degrade video streaming quality.

Video Stabilization Contents General Info Installation To Do General Info Video stabilization is a software-based approach in real-time to eliminating

Mar 7, 2022
Minimalist video maker -- simplify your music score video making process!

VisualScores 极简视频制作程序,简化你的乐谱视频制作! 如果需要编译,请解压 lib 文件夹中压缩包。 使用前请参考 manual 文件夹中的用户手册。 请勿修改、移动或删除 resource 文件夹中的任何文件。 VisualScores Minimalist video maker

Jan 11, 2022
Use rtsp protocol to push local H265 video encoding files

rtspServerH265 Use rtsp protocol to push local H265 video encoding files 项目介绍 C++11实现的RTSP服务器和推流器。主要完成对H265视频编码文件的RTSP推流 使用说明 1.编译并运行程序; 2.打开VLC软件,在媒体

May 18, 2022
SRS is a simple, high efficiency and realtime video server, supports RTMP/WebRTC/HLS/HTTP-FLV/SRT/GB28181.
SRS is a simple, high efficiency and realtime video server, supports RTMP/WebRTC/HLS/HTTP-FLV/SRT/GB28181.

SRS is a simple, high efficiency and realtime video server, supports RTMP/WebRTC/HLS/HTTP-FLV/SRT/GB28181.

Jun 23, 2022
SortNode is a JS binding for SORT: Simple, online, and real-time tracking of multiple objects in a video sequence.

SortNode is a JS binding for SORT: Simple, online, and real-time tracking of multiple objects in a video sequence.

Sep 17, 2021
a simple example of video streaming with a ESP32 AI Thinker
a simple example of video streaming with a ESP32 AI Thinker

esp32-video-streaming its a simple camera system that im trying to make for fun I want to make an async server but idk it doesnt works correctly and w

Mar 9, 2022
Sentry-Picam is a simple wildlife / security camera solution for the Raspberry Pi Zero W, providing 1080p/30fps motion activated H.264 video capture.
Sentry-Picam is a simple wildlife / security camera solution for the Raspberry Pi Zero W, providing 1080p/30fps motion activated H.264 video capture.

Sentry-Picam is a simple wildlife / security camera solution for the Raspberry Pi Zero W, providing 1080p/30fps motion activated H.264 video capture.

Jun 12, 2022
A simple example showing how to render a video with libvlc + raylib.
A simple example showing how to render a video with libvlc + raylib.

Hey! I bet you have been trying to render and control a video with raylib for a long long time. Don't you think you should at least buy me a beer? Wha

May 23, 2022