For software scaling the example is as follows, might help you.
int main(int argc, char **argv)
{
const char *src_filename = NULL;
const char *src_resolution = NULL;
const char *src_pix_fmt_name = NULL;
enum AVPixelFormat src_pix_fmt = AV_PIX_FMT_NONE;
uint8_t *src_data[4];
Perette,
as far as I can tell there are 2 different things relating to codecs:
old API:
AVCodecContext - obtained from stream->codec (this may be the source of
confusion), a pointer which is passed into functions dealing with the codec
AVCodec - obtained from av_codec_find_decoder(context),
I'd like to get rid of calling avformat_find_stream_info (it's slow)
I have a specific source of stream so I know exactly the codec, resolution,
frame rate, etc of the stream
How can I pre populate AVContext with all needed information so I don't
have to call avformat_find_stream_info?
Thanks
Yes, you should use *interrupt_callback*:
https://www.ffmpeg.org/doxygen/3.0/structAVFormatContext.html#a5b37acfe4024d92ee510064e80920b40
https://www.ffmpeg.org/doxygen/3.0/structAVIOInterruptCB.html
This callback function is called repeatedly when there's a blocking
operation like av_read_frame
I seem to be lost in where the values get copied.
Want to create a new h.264 file without an input stream to copy from
Steps
1 - av_encode_codec = avcodec_find_encoder( codec_id )
2 - av_encode_codec_ctx = avcodec_alloc_context3( av_encode_codec )
av_encode_codec_ctx->width = w_;
On 08/22/2016 06:32 PM, Charles wrote:
I seem to be lost in where the values get copied.
Want to create a new h.264 file without an input stream to copy from
Steps
1 - av_encode_codec = avcodec_find_encoder( codec_id )
2 - av_encode_codec_ctx = avcodec_alloc_context3( av_encode_codec )