[FFmpeg-devel] [PATCH] lavc/dnxhdenc: print valid dnxhd profiles when codec parameters are invalid
Matthieu Bouron
matthieu.bouron at gmail.com
Sat Jan 19 12:58:21 CET 2013
---
libavcodec/dnxhdenc.c | 38 +++++++++++++++++++++++++++++++++++++-
1 file changed, 37 insertions(+), 1 deletion(-)
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 690e64f..8a65f33 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -247,6 +247,41 @@ static int dnxhd_init_rc(DNXHDEncContext *ctx)
return -1;
}
+static void dnxhd_print_profiles(AVCodecContext *avctx, int loglevel)
+{
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 36Mbps; pixel format: yuv422p; framerate: 24000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 115Mbps; pixel format: yuv422p; framerate: 24000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 175Mbps; pixel format: yuv422p; framerate: 24000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 175Mbps; pixel format: yuv422p10; framerate: 24000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 120Mbps; pixel format: yuv422p; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 185Mbps; pixel format: yuv422p; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 185Mbps; pixel format: yuv422p10; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080i; bitrate: 120Mbps; pixel format: yuv422p; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080i; bitrate: 185Mbps; pixel format: yuv422p; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080i; bitrate: 185Mbps; pixel format: yuv422p10; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080i; bitrate: 145Mbps; pixel format: yuv422p; framerate: 30000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080i; bitrate: 220Mbps; pixel format: yuv422p; framerate: 30000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080i; bitrate: 220Mbps; pixel format: yuv422p10; framerate: 30000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 240Mbps; pixel format: yuv422p; framerate: 50/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 365Mbps; pixel format: yuv422p; framerate: 50/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 365Mbps; pixel format: yuv422p10; framerate: 50/1\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 290Mbps; pixel format: yuv422p; framerate: 60000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 440Mbps; pixel format: yuv422p; framerate: 60000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1920x1080p; bitrate: 440Mbps; pixel format: yuv422p10; framerate: 60000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 60Mbps; pixel format: yuv422p; framerate: 24000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p; framerate: 24000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p10; framerate: 24000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 60Mbps; pixel format: yuv422p; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 90Mbps; pixel format: yuv422p10; framerate: 25/1\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 120Mbps; pixel format: yuv422p; framerate: 50/1\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 185Mbps; pixel format: yuv422p; framerate: 50/1\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 185Mbps; pixel format: yuv422p10; framerate: 50/1\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 145Mbps; pixel format: yuv422p; framerate: 60000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 220Mbps; pixel format: yuv422p; framerate: 60000/1001\n");
+ av_log(avctx, loglevel, "Frame size: 1280x720p; bitrate: 220Mbps; pixel format: yuv422p10; framerate: 60000/1001\n");
+}
+
static int dnxhd_encode_init(AVCodecContext *avctx)
{
DNXHDEncContext *ctx = avctx->priv_data;
@@ -266,7 +301,8 @@ static int dnxhd_encode_init(AVCodecContext *avctx)
ctx->cid = ff_dnxhd_find_cid(avctx, bit_depth);
if (!ctx->cid) {
- av_log(avctx, AV_LOG_ERROR, "video parameters incompatible with DNxHD\n");
+ av_log(avctx, AV_LOG_ERROR, "video parameters incompatible with DNxHD. Valid DNxHD profiles:\n");
+ dnxhd_print_profiles(avctx, AV_LOG_ERROR);
return -1;
}
av_log(avctx, AV_LOG_DEBUG, "cid %d\n", ctx->cid);
--
1.8.1.1
More information about the ffmpeg-devel
mailing list