I never heard back about this and I think I have a new better solution now. I don't think the current mov.c timecode processing is handling the case where the timecode is in counter mode. Please read the following page 190 from:

https://developer.apple.com/library/mac/documentation/QuickTime/QTFF/qtff.pdf

Specifically:

"Number of frames
An 8-bit integer that contains the number of frames per second for the timecode format. If the time is a counter, this is the number of frames for each counter tick."

I have sample media in counter mode if it helps. I tried to send that before as well, but I think it was too large. Please let me know how else I can help with this enhancement. Feel free to send clarification questions to me.

Thanks,
Jon

On 09/09/2014 12:01 PM, jon wrote:
Hi ffmpeg developers.

I am still new to attempting contributing here, so please let me know if
there is a better approach for this. I am attaching a patch I would like
to incorporate for calculating the stream time_base of the timecode data
track in mov's. Please advise.

Thanks!
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 556411f1ef9f12097a5f779e858e815c26dc92e6..3ceb53424e597de99040d3d669f10421cc208b4d 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -1658,6 +1658,13 @@ static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
                 st->codec->flags2 |= CODEC_FLAG2_DROP_FRAME_TIMECODE;
             st->codec->time_base.den = st->codec->extradata[16]; /* number of frame */
             st->codec->time_base.num = 1;
+            /* adjust for per frame dur in counter mode */
+            if (tmcd_ctx->tmcd_flags & 0x0008) {
+                int timescale = AV_RB32(st->codec->extradata + 8);
+                int framedur = AV_RB32(st->codec->extradata + 12);
+                st->codec->time_base.den *= timescale;
+                st->codec->time_base.num *= framedur;
+            }
             if (size > 30) {
                 uint32_t len = AV_RB32(st->codec->extradata + 18); /* name atom length */
                 uint32_t format = AV_RB32(st->codec->extradata + 22);
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to