[xiph-commits] r10355 - trunk/ffmpeg2theora

j at svn.xiph.org j at svn.xiph.org
Mon Nov 7 08:40:18 PST 2005


Author: j
Date: 2005-11-07 08:40:16 -0800 (Mon, 07 Nov 2005)
New Revision: 10355

Modified:
   trunk/ffmpeg2theora/ffmpeg2theora.c
   trunk/ffmpeg2theora/theorautils.c
Log:
- only update bitrate stats if granulepos is >0
- make default quality settings more consistent



Modified: trunk/ffmpeg2theora/ffmpeg2theora.c
===================================================================
--- trunk/ffmpeg2theora/ffmpeg2theora.c	2005-11-07 16:16:03 UTC (rev 10354)
+++ trunk/ffmpeg2theora/ffmpeg2theora.c	2005-11-07 16:40:16 UTC (rev 10355)
@@ -160,14 +160,14 @@
         // audio
         this->sample_rate = -1;  // samplerate hmhmhm
         this->channels = -1;
-        this->audio_quality=0.297;// audio quality 3
+        this->audio_quality=1*.099;// audio quality 1
         this->audio_bitrate=0;
         this->audiostream = -1;
         
         // video
         this->picture_width=0;      // set to 0 to not resize the output
         this->picture_height=0;      // set to 0 to not resize the output
-        this->video_quality=31.5; // video quality 5
+        this->video_quality=rint(5*6.3); // video quality 5
         this->video_bitrate=0;
         this->sharpness=2;
         this->keyint=64;
@@ -1105,9 +1105,11 @@
     if(argc==2){
         //need a way to set resize here. and not later
         convert->preset=V2V_PRESET_DEFAULT;
+
+// this should not be changed from default if no arguments are given
+/*
         convert->video_quality = rint(5*6.3);
         convert->audio_quality=1*.099;
-/*
         convert->channels=2;
         convert->sample_rate=44100;
 */

Modified: trunk/ffmpeg2theora/theorautils.c
===================================================================
--- trunk/ffmpeg2theora/theorautils.c	2005-11-07 16:16:03 UTC (rev 10354)
+++ trunk/ffmpeg2theora/theorautils.c	2005-11-07 16:40:16 UTC (rev 10355)
@@ -226,11 +226,6 @@
     int minutes = ((long) timebase / 60) % 60;
     int hours = (long) timebase / 3600;
 
-    if(info->vkbps<0)
-        info->vkbps=0;
-    if(info->akbps<0)
-        info->akbps=0;
-
     fprintf (stderr,"\r      %d:%02d:%02d.%02d audio: %dkbps video: %dkbps                  ",
          hours, minutes, seconds, hundredths,info->akbps, info->vkbps);
 }
@@ -249,6 +244,8 @@
   info->audiopage_valid = 0;
 
   info->akbps = rint (info->audio_bytesout * 8. / info->audiotime * .001);
+  if(info->akbps<0)
+    info->akbps=0;
   print_stats(info, info->audiotime);
 }
 
@@ -266,6 +263,8 @@
   info->videopage_valid = 0;
 
   info->vkbps = rint (info->video_bytesout * 8. / info->videotime * .001);
+  if(info->vkbps<0)
+    info->vkbps=0;
   print_stats(info, info->videotime);
 }
 
@@ -289,8 +288,10 @@
           memcpy(info->videopage+og.header_len , og.body, og.body_len);
 
           info->videopage_valid = 1;
-          info->videotime = theora_granule_time (&info->td,
+          if(ogg_page_granulepos(&og)>0) {
+            info->videotime = theora_granule_time (&info->td,
                   ogg_page_granulepos(&og));
+          }
         }
       }
       if(!info->video_only && !info->audiopage_valid) {
@@ -305,8 +306,10 @@
           memcpy(info->audiopage+og.header_len , og.body, og.body_len);
 
           info->audiopage_valid = 1;
-          info->audiotime= vorbis_granule_time (&info->vd, 
+          if(ogg_page_granulepos(&og)>0) {
+            info->audiotime= vorbis_granule_time (&info->vd, 
                   ogg_page_granulepos(&og));
+          }
         }
       }
 



More information about the commits mailing list