Raster to Video Tool

4366
3
03-27-2013 10:05 AM
courtneygarlock
New Contributor II
I'm having an issue exporting my .avi video
I am using a version of the following script:

# Import system modules
import arcpy
from arcpy import env

# Set environment settings
env.workspace = "c:/data"

#Set local variables
inFolder = "images"
outputVideoFile = "outputVideo.avi"

#Execute RaserToVideo
arcpy.RasterToVideo_conversion(inFolder, outputVideoFile, "BMP", "Microsoft Video 1", "TIME", "35", "90")



It says that the codec is "optional" but when I leave it out I get an error stating the value is not a member of Microsoft Video 1 etc...

When I leave the "Microsoft Video 1" in the code, the video is exported but when I try to play the video I get an error saying the file type is supported by the playet but the file was compressed using codec that is not supported. I'm using Windows Media player,

What do I need to change to get this to play?
Tags (2)
0 Kudos
3 Replies
courtneygarlock
New Contributor II
new problem:


using this script
#Execute RaserToVideo
arcpy.RasterToVideo_conversion(inFolder, outputVideoFile, "BMP", "Microsoft Video 1", "TIME", "24", "90")

I can not set the time duration "24" any higher. If I set it to 25 (seconds) or above it will not open in windos media player and I get the same error message as before.
0 Kudos
JamesCrandall
MVP Frequent Contributor
Posting on this thread to subscribe and follow along because I suspect this topic will continue on for a while.  Unfortunately, it doesn't seem like there has been a whole lot of user-experience postings on this topic and can be difficult to get help.

Also: I am doing much of my time-series animation work (interpolation results) manually but experiencing a lot of frustration getting things just right.  I end up jumping between the Time Slider component and the Animation toolbar as they seem to work hand-in-hand.  As well as the time properties of the raster(s) themselves.

Q: Are you using a Raster Catalog?
Q: Have you done what you want manually before attempting to script the process?

This has been my workflow, which seems to be a great choice.  However, my next step is to script'ize as much of this as possible -- hence my reason for posting on this thread (again sorry for not posting direct answers).

1. Generate a FGDB of all my Raster Datasets
2. Create a Raster Catalog and populate with the individual Rasters
3. Add a "Time" field and populate with consecutive dates (python/field calculator)
4. Set the time properties when adding the Raster Catalog to the TOC
5. Symbolize the raster catalog
6. Use the tools on the Time Slider to add the date/time stamp to the layout
7. Use the Animation Toolbar to export to Video (accepting the defaults).

Good luck!
j
0 Kudos
RamB
by
Occasional Contributor III

This works for me. However, if it does not work for anyone, here is additional tip. Do all the above procedure in ArcCatalog and not ArcMap.

0 Kudos