gdal_polygonize [-o name=value] [-nomask] [-mask filename] raster_file [-b band] [-q] [-f ogr_format] out_file [layer] [fieldname]
The utility will create the output vector datasource if it does not already exist, defaulting to GML format.
The utility is based on the GDALPolygonize() function which has additional details on the algorithm.