[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43180] trunk/blender/source/blender/ editors/screen/screendump.c: Fix #29796: Poor screencast quality with any AVI Codec

Sergey Sharybin sergey.vfx at gmail.com
Thu Jan 5 19:04:02 CET 2012


Revision: 43180
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43180
Author:   nazgul
Date:     2012-01-05 18:03:48 +0000 (Thu, 05 Jan 2012)
Log Message:
-----------
Fix #29796: Poor screencast quality with any AVI Codec

Looks like some codecs depends on valid PTS set for frame to encode
frame in right way. PTS is calculating based on current frame number
appending to stream which is stored in render data.

So use rd.cfra in screenshot_startjob() instead of keeping own variable
for reporting current frame number.

Now codecs should be happy and work nice.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/screen/screendump.c

Modified: trunk/blender/source/blender/editors/screen/screendump.c
===================================================================
--- trunk/blender/source/blender/editors/screen/screendump.c	2012-01-05 17:50:34 UTC (rev 43179)
+++ trunk/blender/source/blender/editors/screen/screendump.c	2012-01-05 18:03:48 UTC (rev 43180)
@@ -278,7 +278,6 @@
 	ScreenshotJob *sj= sjv;
 	RenderData rd= sj->scene->r;
 	bMovieHandle *mh= BKE_get_movie_handle(sj->scene->r.im_format.imtype);
-	int cfra= 1;
 	
 	/* we need this as local variables for renderdata */
 	rd.frs_sec= U.scrcastfps;
@@ -303,9 +302,9 @@
 		if(sj->dumprect) {
 			
 			if(mh) {
-				if(mh->append_movie(&rd, cfra, (int *)sj->dumprect, sj->dumpsx, sj->dumpsy, &sj->reports)) {
-					BKE_reportf(&sj->reports, RPT_INFO, "Appended frame: %d", cfra);
-					printf("Appended frame %d\n", cfra);
+				if(mh->append_movie(&rd, rd.cfra, (int *)sj->dumprect, sj->dumpsx, sj->dumpsy, &sj->reports)) {
+					BKE_reportf(&sj->reports, RPT_INFO, "Appended frame: %d", rd.cfra);
+					printf("Appended frame %d\n", rd.cfra);
 				} else
 					break;
 			}
@@ -314,7 +313,7 @@
 				char name[FILE_MAX];
 				int ok;
 				
-				BKE_makepicstring(name, rd.pic, sj->bmain->name, cfra, rd.im_format.imtype, rd.scemode & R_EXTENSION, TRUE);
+				BKE_makepicstring(name, rd.pic, sj->bmain->name, rd.cfra, rd.im_format.imtype, rd.scemode & R_EXTENSION, TRUE);
 				
 				ibuf->rect= sj->dumprect;
 				ok= BKE_write_ibuf(ibuf, name, &rd.im_format);
@@ -338,7 +337,7 @@
 			
 			*do_update= 1;
 			
-			cfra++;
+			rd.cfra++;
 
 		}
 		else 



More information about the Bf-blender-cvs mailing list