Writing a video file using H.264 compression in OpenCV

You can certainly use the VideoWriter class, but you need to use the correct FourCC code that represents the the H264 standard. FourCC stands for Four Character Code, which is an identifier for a video codec, compression format, colour or pixel format used in media files. Specifically, when you create a VideoWriter object, you specify … Read more

FFMPEG: chroma key / greenscreen filter for images / video [closed]

The answer (now) is yes, there is a filter for generating chroma-keys and overlaying them. The filter name is “color key”. There are examples on the site, here’s the command: ffmpeg -i <base-video> -i <overlay-video> -filter_complex ‘[1:v]colorkey=0x<color>:<similarity>:<blend>[ckout];[0:v][ckout]overlay[out]’ -map ‘[out]’ <output-file> where <color> is the rgb color to match in hex (ex: 0x000000 for black), <similarity> … Read more

How to split video or audio by silent parts

You could first use ffmpeg to detect intervals of silence, like this ffmpeg -i “input.mov” -af silencedetect=noise=-30dB:d=0.5 -f null – 2> vol.txt This will produce console output with readings that look like this: [silencedetect @ 00000000004b02c0] silence_start: -0.0306667 [silencedetect @ 00000000004b02c0] silence_end: 1.42767 | silence_duration: 1.45833 [silencedetect @ 00000000004b02c0] silence_start: 2.21583 [silencedetect @ 00000000004b02c0] silence_end: … Read more

Post processing in ffmpeg to move ‘moov atom’ in MP4 files (qt-faststart)

Seems like faststart support has been included in ffmpeg. FFmpeg Formats Documentation: -movflags faststart Run a second pass moving the moov atom on top of the file. This operation can take a while, and will not work in various situations such as fragmented output, thus it is not enabled by default.

Is there a way to use ffmpeg to determine the encoding of a file before transcoding?

Use ffprobe Example command $ ffprobe -v error -select_streams v:0 -show_entries stream=codec_name -of default=nokey=1:noprint_wrappers=1 input.mp4 Result h264 Option descriptions -v error Omit extra information except for fatal errors. -select_streams v:0 Select only the first video stream. Otherwise the codec_name for all other streams in the file, such as audio, will be shown as well. -show_entries … Read more

ffmpeg video to opengl texture

Is the texture initialized when you call glTexSubImage2D? You need to call glTexImage2D (not Sub) one time to initialize the texture object. Use NULL for the data pointer, OpenGL will then initialize a texture without copying data. answered EDIT You’re not supplying mipmaping levels. So did you disable mipmaping? glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILER, linear_interpolation ? GL_LINEAR : … Read more