summaryrefslogtreecommitdiff
authorMichael Niedermayer <michaelni@gmx.at>2013-09-28 15:52:45 (GMT)
committer Michael Niedermayer <michaelni@gmx.at>2013-10-02 20:56:03 (GMT)
commit64327aabb96dec98f72d4b64b0040c9dfbac9faf (patch)
tree6c9a6d1fc1a59c2bcfba543ff0fd1e4ef7f13d0e
parent5082fcc0e2c899484534637544463effbf50d9d1 (diff)
downloadffmpeg-64327aabb96dec98f72d4b64b0040c9dfbac9faf.zip
ffmpeg-64327aabb96dec98f72d4b64b0040c9dfbac9faf.tar.gz
ffmpeg-64327aabb96dec98f72d4b64b0040c9dfbac9faf.tar.bz2
ffmpeg: add support to force specific AVCodecs
previously only codec_ids could be forced, which did not allow forcing a specific implementation like libopenjpeg vs jpeg2000. Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat
-rw-r--r--ffmpeg_opt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 8ff5bdf..a542b8d 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -785,6 +785,14 @@ static int open_input_file(OptionsContext *o, const char *filename)
find_codec_or_die(audio_codec_name , AVMEDIA_TYPE_AUDIO , 0)->id : AV_CODEC_ID_NONE;
ic->subtitle_codec_id= subtitle_codec_name ?
find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0)->id : AV_CODEC_ID_NONE;
+
+ if (video_codec_name)
+ av_format_set_video_codec (ic, find_codec_or_die(video_codec_name , AVMEDIA_TYPE_VIDEO , 0));
+ if (audio_codec_name)
+ av_format_set_audio_codec (ic, find_codec_or_die(audio_codec_name , AVMEDIA_TYPE_AUDIO , 0));
+ if (subtitle_codec_name)
+ av_format_set_subtitle_codec(ic, find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0));
+
ic->flags |= AVFMT_FLAG_NONBLOCK;
ic->interrupt_callback = int_cb;