ffmpeg quicktime fps workaround
authorGood Guy <good1.2guy@gmail.com>
Thu, 29 Jun 2017 00:53:08 +0000 (18:53 -0600)
committerGood Guy <good1.2guy@gmail.com>
Thu, 29 Jun 2017 00:53:08 +0000 (18:53 -0600)
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/cinelerra/ffmpeg.h

index 243c4e15cf145693d83b363096b59f982b3dd344..70440b64c307b3d782081e0d212b82ef3ffea8aa 100644 (file)
@@ -791,6 +791,11 @@ int FFAudioStream::encode_frame(AVFrame *frame)
        return FFStream::encode_frame(frame);
 }
 
+int FFAudioStream::write_packet(FFPacket &pkt)
+{
+       return FFStream::write_packet(pkt);
+}
+
 void FFAudioStream::load_markers()
 {
        IndexState *index_state = ffmpeg->file_base->asset->index_state;
@@ -921,6 +926,13 @@ int FFVideoStream::encode_frame(AVFrame *frame)
        return FFStream::encode_frame(frame);
 }
 
+int FFVideoStream::write_packet(FFPacket &pkt)
+{
+       if( !(ffmpeg->fmt_ctx->oformat->flags & AVFMT_VARIABLE_FPS) )
+               pkt->duration = 1;
+       return FFStream::write_packet(pkt);
+}
+
 AVPixelFormat FFVideoConvert::color_model_to_pix_fmt(int color_model)
 {
        switch( color_model ) {
index 5f3f93f18d784bce9c3b941d185cd3a3bd5fa93a..34bb736448ddc4384990abc6335857ece16e0d37 100644 (file)
@@ -80,9 +80,9 @@ public:
 
        virtual int encode_activate();
        virtual int decode_activate();
+       virtual int write_packet(FFPacket &pkt);
        int read_packet();
        int seek(int64_t no, double rate);
-       int write_packet(FFPacket &pkt);
        int flush();
        int decode(AVFrame *frame);
        void load_markers(IndexMarks &marks, double rate);
@@ -145,6 +145,7 @@ class FFAudioStream : public FFStream {
        int write(const float *fp, long len);
        int zero(long len);
        int write(const double *dp, long len, int ch);
+       int write_packet(FFPacket &pkt);
 public:
        FFAudioStream(FFMPEG *ffmpeg, AVStream *strm, int idx, int fidx);
        virtual ~FFAudioStream();
@@ -205,6 +206,7 @@ public:
 };
 
 class FFVideoStream : public FFStream, public FFVideoConvert {
+       int write_packet(FFPacket &pkt);
 public:
        FFVideoStream(FFMPEG *ffmpeg, AVStream *strm, int idx, int fidx);
        virtual ~FFVideoStream();