arduino-audio-tools
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
Video.h File Reference
#include "AudioTools/CoreAudio/AudioOutput.h"
#include "AudioTools/CoreAudio/Buffers.h"
#include "AudioTools/Video/CodecCopy.h"
#include "stdint.h"

Go to the source code of this file.

Classes

class  VideoAudioBufferedSync
 Logic to Synchronize video and audio output: we use a buffer to store the audio and instead of delaying the frames with delay() we play audio. The bufferSize defines the audio buffer in bytes. The correctionMs is used to slow down or speed up the playback of the video to prevent any audio buffer underflows. More...
 
class  VideoAudioSync
 Logic to Synchronize video and audio output: This is the minimum implementatin which actually does not synchronize, but directly processes the data. No additinal memory is used! Provide your own optimized platform specific implementation. More...
 
class  VideoFrameSource
 Pull-based provider of one already-encoded video/image frame at a time - e.g. wraps a camera capture + H264Encoder/MJPEG capture pipeline. Used by VideoMuxerWithTasks's video task, which calls nextFrame() once per iteration, at the rate given by videoInfo().fps. Implementations should produce/capture the frame here directly (not defer it): a slow nextFrame() only delays whatever is pulling from it. More...
 
struct  VideoInfo
 Basic video information (width/height/codec/frame size), analogous to AudioInfo - common to both DemuxerAVI and DemuxerMP4, accessible via their getVideoInfo() getter. More...
 
class  VideoInfoSource
 
class  VideoOutput
 Abstract class for video playback. This class is used to assemble a complete video frame in memory. A video frame is written via one or more write() calls, then finalized with flush() - implementations use flush() to know a frame is complete (there is no separate frame-size hint, unlike a length-prefixed chunk format). More...
 

Namespaces

namespace  audio_tools
 Generic Implementation of sound input and output for desktop environments using portaudio.
 

Enumerations

enum  StreamContentType { Audio , Video }
 Which track write() feeds, for muxers (MuxerAVI, MuxerMP4) that double as a plain, generic Print-like sink for both tracks - see setStreamType()/streamType() on those classes. More...
 
enum class  VideoFormat {
  H264 , MJPEG , MPEG4 , RAW ,
  YUV422 , RGB565 , RGB666 , RGB888 ,
  I420 , MPEG1 , UNKNOWN
}
 Video codec/pixel-format identifier, shared by two unrelated uses: the (single) video stream of a container (DemuxerAVI/MuxerAVI and DemuxerMP4 - much like AudioFormat is shared across the audio demuxers, despite its WAV-flavored name), and the decoded-picture pixel format VideoDecoder::setVideoFormat() selects. H264 is the primary target for muxing; the others are AVI-specific conveniences or decoder-only. More...
 

Functions

bool isH264KeyFrame (const uint8_t *data, size_t len)
 True if the given Annex-B H.264 access unit contains an IDR slice NAL unit (nal_unit_type 5) - the reliable way to tell a real keyframe/sync-sample apart from a P-frame, since nothing in the byte layout itself says so without inspecting NAL headers. Used e.g. to determine Muxer::addVideoFrame()'s isKeyFrame argument for an already-encoded VideoFormat::H264 frame.
 
size_t videoFrameSizeBytes (VideoFormat format, uint16_t width, uint16_t height)
 Fixed per-frame size (bytes) for a raw/uncompressed VideoFormat at the given resolution - 0 for compressed formats (H264/MJPEG/MPEG4) or VideoFormat::UNKNOWN, since their frame size varies per frame.