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

Nov 29, 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

Dec 8, 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

Nov 27, 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

Jun 18, 2022

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.

Jul 19, 2022

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

Nov 30, 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.

Nov 30, 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

Nov 21, 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

Nov 29, 2022
Comments
  • Linux FindFFmpeg Support

    Linux FindFFmpeg Support

    I've added CMake support for Linux, specifically Debian however it should work on other Linux distros. I also made minor changes to encoder.h and encoder.cpp for GCC support.

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

Dec 3, 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.

Dec 2, 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

Nov 23, 2022
Minimalist video maker -- simplify your music score video making process!

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

Sep 7, 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软件,在媒体

Oct 12, 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.

Dec 5, 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.

Aug 2, 2022
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.

Oct 9, 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

Nov 8, 2022