Check JPG/RAW to SD Card Class Speed - Completed and Working Scripts - CHDK Forum

Check JPG/RAW to SD Card Class Speed

  • 0 Replies
  • 2765 Views
*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Check JPG/RAW to SD Card Class Speed
« on: 02 / August / 2012, 00:21:26 »
Advertisements
This script was designed to test the average JPG/RAW to SD Card class processing times for a SD card &  camera - in particular, to check how the class of SD card affects the processing times. The script checks JPG & RAW times during each run. This script is not intended as a replacement to actual benchmark testing.

The script has one parameter: Save log. Although the results are displayed on the OSD after a run, this parameter will allow the user to save the results of each test run as an individual Log file. Each log file will be saved in the CHDK/Scripts/Logs folder with a name formatted as 'LOG_xxxx.TXT', where the xxxx is the minute & second the log file starts recording. For example, LOG_4306.TXT was created and it had the following contents:

     Date: 7/31/2012
     Time: 19:43:6
 
     Continuous
     avg time in ms
     Burst JPG: 1078
     Burst RAW: 3622

The script determines the current drive mode you are using - Single Shot, Continuous or 'Other'. Although all of the Canon cameras have the first two modes, some cameras may have more drive modes. Since these drive modes vary by the camera, for any other mode the script will print "Other(x)" where x is the number associated with the option selected.

A. If the drive mode is Single Shot, the script locks the AutoFocus, sets the camera to non-RAW (JPGs), shoots five shots, then re-sets the camera to RAW and shoots five shots. The script calculates the average milliseconds for each and displays the results on the OSD. A typical display would look something like this:

        Single Shot 
        avg time in ms
        JPG: 5232
        RAW: 7106

B. If the drive mode is Continuous, the script locks the focus, sets the camera to non-RAW (JPG), shoots a 5 shot burst and calculates the average time per shot. The script delays 3 seconds (required for some class 2 SD Cards), then performs the same sequence in RAW. The results are then displayed in milliseconds. There is an additional 3 seconds delay after the RAW burst to allow the camera time to finish before the script does the final processing (again, required for some class 2 SD Cards). The script results for each JPG shot agreed with the speed indicated in the Canon manual. A typical display will look something like this:

        Continuous
        avg time in ms
        Burst JPG: 1448
        Burst RAW: 3266

For the test, you should point the camera at an object that has a relatively controlled light source. Each SD card should be freshly formatted and you should use fully charged batteries to insure the best results. I also recommend running each test 3 times to compare the results just in case something odd happens during a set. These are the results from a recent test on a SX20IS:

     Single Shot
     Brand     Class     JPG     RAW
     ---------    -----     ------   ------
     SanDisk     2       4382    9882
     PNY           4       4458    6910
     SanDisk    10       4420    6212
       Extreme

     Continuous Mode
     Brand     Class     JPG     RAW
     ---------    -----     ------   ------
     SanDisk     2        924    6584
     PNY           4        928    3554
     SanDisk    10       922    3044
       Extreme

Save the script as SdSpeed.BAS

Note: You might be wondering why the goto "Init"  statement is at the beginning of the script and the initiialization steps take place at the end of the script. Since we are doing time sensitive tests, the time sensitive code needs to be located as close to the start of the script as possible. This is especially true when scripting Continuous mode (burst) sequences.


Code: [Select]
rem Author SkyWalker9
@title Sd Card Speed Test
@param h Save log (0=No)
@default h 1
    goto "Init"
:Cont_B 
rem test amount of time for burst save
    e=get_exp_count
    E=e+5
    set_raw 0
    b=get_tick_count
    press "shoot_full"
:cont_J
    e=get_exp_count
    if e<E then goto "cont_J"
    release "shoot_full"
    a=get_tick_count
    J=(a-b)/5
    sleep 3000
    e=get_exp_count
    E=e+5
    set_raw 1
    b=get_tick_count
    press "shoot_full"
:cont_R
    e=get_exp_count
    if e<E then goto "cont_R"
    release "shoot_full"
    a=get_tick_count
    sleep 3000
    R=(a-b)/5
rem Display burst results in milliseconds
    print "avg time in ms"
    print "Burst JPG: "J
    print "Burst RAW: "R
    goto "fini"
:Cont_S 
rem test for JPG
  set_raw 0
  a=get_tick_count
  J=a
  for i=1 to 5
    shoot
  next i
  a=get_tick_count
  J=(a-J)/5
rem test for RAW
  set_raw 1
  a=get_tick_count
  R=a
  for i=1 to 5
    shoot
  next i
  a=get_tick_count
  R=(a-R)/5
rem Display results in milliseconds
  print "avg time in ms"
  print "JPG: "J
  print "RAW: "R
  goto "fini"
:Init
rem 0=second 1=minute 2=hour 3=day 4=month 5=year
  if h<>1 then goto "skip_log"
  z=get_time 0
  y=get_time 1
  x=get_time 2
  m=get_time 3
  n=get_time 4
  p=get_time 5
  g=y*100+z
  if g<1 then g=1
  if g>9999 then g=9999
  print_screen g
  print "Date: "n"/"m"/"p
  print "Time: "x":"y":"z
  print " "
:skip_log
  J=0
  R=0
  rem lock AutoFocus
  set_aflock(1)
rem drive mode 0=Single & 1=Continuous
  x=get_drive_mode
  if x=1 then goto "Cont"
  if x<0 or x>1 then goto "Other"
   print "Single Shot"
   goto "Cont_S"
:Cont
  print "Continuous"
  goto "Cont_B"
:Other
  print "Other("x")"
:fini
  if h<>0 then print_screen 0
rem unlock AutoFocus
  set_aflock(0)
end
« Last Edit: 02 / August / 2012, 00:27:43 by SkyWalker9 »

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal