[FFmpeg-cvslog] avcodec/cfhdenc: also write FrameNumber tag

Paul B Mahol git at videolan.org
Sat Aug 8 13:12:56 EEST 2020


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Aug  4 11:25:25 2020 +0200| [a96506f01748d746591e13d9e1fceb862efde922] | committer: Paul B Mahol

avcodec/cfhdenc: also write FrameNumber tag

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a96506f01748d746591e13d9e1fceb862efde922
---

 libavcodec/cfhd.h    | 1 +
 libavcodec/cfhdenc.c | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/libavcodec/cfhd.h b/libavcodec/cfhd.h
index ba381f79f2..b889fe5fa2 100644
--- a/libavcodec/cfhd.h
+++ b/libavcodec/cfhd.h
@@ -72,6 +72,7 @@ enum CFHDParam {
     BandTrailer      =  56,
     ChannelNumber    =  62,
     SampleFlags      =  68,
+    FrameNumber      =  69,
     Precision        =  70,
     InputFormat      =  71,
     BandCodingFlags  =  72,
diff --git a/libavcodec/cfhdenc.c b/libavcodec/cfhdenc.c
index 10cf7c03ac..9b21bc2894 100644
--- a/libavcodec/cfhdenc.c
+++ b/libavcodec/cfhdenc.c
@@ -542,7 +542,7 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         }
     }
 
-    ret = ff_alloc_packet2(avctx, pkt, 60LL + s->planes * (2LL * avctx->width * avctx->height + 1000LL), 0);
+    ret = ff_alloc_packet2(avctx, pkt, 64LL + s->planes * (2LL * avctx->width * avctx->height + 1000LL), 0);
     if (ret < 0)
         return ret;
 
@@ -587,6 +587,9 @@ static int cfhd_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     bytestream2_put_be16(pby, ImageHeight);
     bytestream2_put_be16(pby, avctx->height);
 
+    bytestream2_put_be16(pby, -FrameNumber);
+    bytestream2_put_be16(pby, avctx->frame_number);
+
     bytestream2_put_be16(pby, Precision);
     bytestream2_put_be16(pby, avctx->pix_fmt == AV_PIX_FMT_YUV422P10 ? 10 : 12);
 



More information about the ffmpeg-cvslog mailing list