pCodecCtx=pFormatCtx->streams[videoStream]->codec;
//Find the decoder for the video stream
pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
if(pCodec==NULL)
{
LOGI(1, "naInitFile::Unsupported codec!");
return ;
}
LOGI(10, "naInitFile::Find the decoder for the video stream");
// Open codec
if(avcodec_open(pCodecCtx, pCodec)<0)
{
LOGI(1, "naInitFile::Could not open codec");
return ; // Could not open codec
}
out_codec = avcodec_find_encoder(pCodecCtx->codec_id);
if (out_codec == NULL)
{
LOGI(1,"codec not found\n");
return;
}
if (avcodec_open(pCodecCtx, out_codec) < 0)
{
LOGI(1,"could not open codec\n");
exit(0);
}
Смущает, но ничего другого не придумалось.... В идеале если переписать полностю конекст, изменить и вывисти все это счастье в новый файл вроди должно б было работать...