bytedeco/javacv
View on GitHubAutomatic conversion to supported format in FFmpegFrameRecorder?
Open
#1,183 opened on Apr 10, 2019
enhancementhelp wanted
Repository metrics
- Stars
- (6,985 stars)
- PR merge metrics
- (No merged PRs in 30d)
Description
I have video frames in a specific format, which is not always supported by an encoder. Is there a way to instruct FFmpegFrameRecorder to convert the data from my (known) format to one of the desired formats before encoding? Or maybe a sub-automatic way? I tried going through supported formats for an encoder, like so:
avcodec.AVCodec enc = avcodec_find_encoder_by_name(encoder);
IntPointer formats = enc.pix_fmts();
// going through formats using get() and storing a format inside selectedFormat
and setting one of those in recorder, like so:
recorder.setPixelFormat(selectedFormat);
and recording frame like so:
recorder.record(frame, PIXEL_FORMAT); // pixel format is the format of frame
It doesn't work, obviously. Am I doing it wrong?