aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2012-03-26 13:02:54 +0200
committerAnton Khirnov <anton@khirnov.net>2012-03-28 09:29:04 +0200
commita839dbb94ed9244a1678339dbb05355d8257a126 (patch)
treecea6456154e991a41da24adad92fca0f9a355226 /libavcodec
parent3c6607eb6f946ed3e108db3f0694cab7e5a5df7e (diff)
downloadffmpeg-a839dbb94ed9244a1678339dbb05355d8257a126.tar.gz
dvenc: print allowed profiles if the video doesn't conform to any of them.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/dv.c6
-rw-r--r--libavcodec/dvdata.c12
-rw-r--r--libavcodec/dvdata.h5
3 files changed, 21 insertions, 2 deletions
diff --git a/libavcodec/dv.c b/libavcodec/dv.c
index aba94eba4f..83b6960f38 100644
--- a/libavcodec/dv.c
+++ b/libavcodec/dv.c
@@ -323,9 +323,11 @@ av_cold int ff_dvvideo_init(AVCodecContext *avctx)
static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
{
if (!avpriv_dv_codec_profile(avctx)) {
- av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video\n",
+ av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video. "
+ "Valid DV profiles are:\n",
avctx->width, avctx->height, av_get_pix_fmt_name(avctx->pix_fmt));
- return -1;
+ ff_dv_print_profiles(avctx, AV_LOG_ERROR);
+ return AVERROR(EINVAL);
}
return ff_dvvideo_init(avctx);
diff --git a/libavcodec/dvdata.c b/libavcodec/dvdata.c
index 1d32304edf..6d123a9741 100644
--- a/libavcodec/dvdata.c
+++ b/libavcodec/dvdata.c
@@ -25,6 +25,7 @@
*/
#include "libavutil/rational.h"
+#include "libavutil/pixdesc.h"
#include "avcodec.h"
#include "dvdata.h"
@@ -322,3 +323,14 @@ const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec)
return NULL;
}
+
+void ff_dv_print_profiles(void *logctx, int loglevel)
+{
+ int i;
+ for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++) {
+ const DVprofile *p = &dv_profiles[i];
+ av_log(logctx, loglevel, "Frame size: %dx%d; pixel format: %s, "
+ "framerate: %d/%d\n", p->width, p->height, av_get_pix_fmt_name(p->pix_fmt),
+ p->time_base.den, p->time_base.num);
+ }
+}
diff --git a/libavcodec/dvdata.h b/libavcodec/dvdata.h
index 8544d61a58..8b4811ac69 100644
--- a/libavcodec/dvdata.h
+++ b/libavcodec/dvdata.h
@@ -154,4 +154,9 @@ static inline void dv_calculate_mb_xy(DVVideoContext *s, DVwork_chunk *work_chun
}
}
+/**
+ * Print all allowed DV profiles into logctx at specified logging level.
+ */
+void ff_dv_print_profiles(void *logctx, int loglevel);
+
#endif /* AVCODEC_DVDATA_H */