[Avidemux-svn-commit] r4979 - branches/avidemux_2.6_branch_mean/avidemux_plugins/ADM_videoEncoder/ffMpeg4

mean at BerliOS mean at mail.berlios.de
Wed Jul 1 21:28:22 CEST 2009


Author: mean
Date: 2009-07-01 21:28:22 +0200 (Wed, 01 Jul 2009)
New Revision: 4979

Modified:
   branches/avidemux_2.6_branch_mean/avidemux_plugins/ADM_videoEncoder/ffMpeg4/ADM_ffMpeg4.cpp
Log:
[ffMpeg4] Fix QScale (must be set prior to open) + fix time_base (same)

Modified: branches/avidemux_2.6_branch_mean/avidemux_plugins/ADM_videoEncoder/ffMpeg4/ADM_ffMpeg4.cpp
===================================================================
--- branches/avidemux_2.6_branch_mean/avidemux_plugins/ADM_videoEncoder/ffMpeg4/ADM_ffMpeg4.cpp	2009-07-01 19:28:20 UTC (rev 4978)
+++ branches/avidemux_2.6_branch_mean/avidemux_plugins/ADM_videoEncoder/ffMpeg4/ADM_ffMpeg4.cpp	2009-07-01 19:28:22 UTC (rev 4979)
@@ -82,8 +82,19 @@
 */
 bool ADM_ffMpeg4Encoder::setup(void)
 {
+    switch(Settings.params.mode)
+    {
+      case COMPRESS_CQ:
+            _context->flags |= CODEC_FLAG_QSCALE;
+            break;
+     default:
+            return false;
+    }
     if(false== ADM_coreVideoEncoderFFmpeg::setup(CODEC_ID_MPEG4))
         return false;
+
+
+
     presetContext(&Settings);
     printf("[ffMpeg] Setup ok\n");
     return true;
@@ -118,6 +129,8 @@
      default:
             return false;
     }
+    printf("[CODEC] Flags = 0x%x, QSCALE=%x, bit_rate=%d, quality=%d qz=%d\n",_context->flags,CODEC_FLAG_QSCALE,
+                                     _context->bit_rate,  _frame.quality, _frame.quality/ FF_QP2LAMBDA);     
     int sz=0;
     _frame.reordered_opaque=image->Pts;
     if ((sz = avcodec_encode_video (_context, out->data, out->bufferSize, &_frame)) < 0)
@@ -247,12 +260,8 @@
   _context->p_masking = 0.0;
   _context->bit_rate = 0;
 
-  // Compute den/num from source (type ADM_coreVideoFilter)
-  FilterInfo *info=source->getInfo();
-  uint64_t frameIncrement=info->frameIncrement;
-  _context->time_base.num=frameIncrement;
-  _context->time_base.den=1000000LL;
-  printf("[LAVCODEC] Frame increment ~ %d ms\n",(int)(frameIncrement/1000));
+  // Set frame rate den/num
+  prolog();
   return true;
 }
 /**




More information about the Avidemux-svn-commit mailing list