Render a video thumbnail with an image style

Drupal media module fetches thumbnails for videos and stores them locally. Here is a snippet how you can access the thumbnail and render it using an image style.

$media = field_get_items('node', $node, 'field_media'); 
if (!empty($media)) { 
  $media = $media[0]['file']; 
  if ($media->type == 'video') { 
    $video = file_stream_wrapper_get_instance_by_uri($media->uri); 
    $thumbnail = $video->getLocalThumbnailPath(); 
    $image_path = file_create_url(image_style_url('og_image', $thumbnail)); 
  }
}