[FFmpeg-devel] *** GMX Spamverdacht *** [PATCH] RoQ encoder: support different integer framerates

Timothy Gu timothygu99 at gmail.com
Sun Feb 2 00:56:31 CET 2014


On Sat, Feb 1, 2014 at 3:44 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Fri, Jan 31, 2014 at 08:12:12PM +0000, u-owvm at aetey.se wrote:
>> Even though the most common framerate for RoQ is 30fps,
>> the format supports other framerates too.
>>
>> Attaching the patch.
>>
>> Regards,
>> Rl
>
>>  libavcodec/roqvideoenc.c |   17 ++++++++++++++++-
>>  libavformat/idroqenc.c   |   13 +++++++++++--
>>  2 files changed, 27 insertions(+), 3 deletions(-)
>> 028fc0b0f6b0c1d63ed5b218f2e746583c1b5292  0003-RoQ-encoder-support-different-integer-framerates.patch
>> From 7f5b836388da158cb8d3c8e244009c1f4a88e5ab Mon Sep 17 00:00:00 2001
>> From: Rl <addr-see-the-website at aetey.se>
>> Date: Fri, 31 Jan 2014 21:09:06 +0100
>> Subject: [PATCH 3/3] RoQ encoder: support different integer framerates
>>  Reply-To:
>>
>> Even though the most common framerate for RoQ is 30fps,
>> the format supports other framerates too.
>> ---
>>  libavcodec/roqvideoenc.c |   17 ++++++++++++++++-
>>  libavformat/idroqenc.c   |   13 +++++++++++--
>>  2 files changed, 27 insertions(+), 3 deletions(-)
>>
>> diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c
>> index 07a4767..eced73f 100644
>> --- a/libavcodec/roqvideoenc.c
>> +++ b/libavcodec/roqvideoenc.c
>> @@ -961,6 +961,21 @@ static av_cold int roq_encode_init(AVCodecContext *avctx)
>>      av_lfg_init(&enc->randctx, 1);
>>
>>      enc->framesSinceKeyframe = 0;
>> +
>> +    if (avctx->time_base.num != 1) {
>> +        av_log(avctx, AV_LOG_ERROR, "Frame rate must be an integer\n");
>> +        return -1;
>> +    }
>> +
>> +    if (avctx->time_base.den > 255) {
>> +        av_log(avctx, AV_LOG_ERROR, "Frame rate may not exceed 255fps\n");
>> +        return -1;
>> +    }
>
> these 2 should probably be in the muxer instead of the encoder
> as its the muxer that cannot store other values

Also return AVERROR(EINVAL);

>
>
>> +
>
>> +    if (avctx->time_base.den != 30) {
>> +        av_log(avctx, AV_LOG_ERROR, "Warning, for vintage compatibility fps must be 30\n");
>
> warning instead of error is probably better

Also s/Warning, f/F/

[...]

Timothy


More information about the ffmpeg-devel mailing list