/**
  * Extract preview image
  *
  * @param
  * @return
  */
 function extractPreviewImageObject()
 {
     global $ilCtrl;
     $this->checkPermission("write");
     $this->mcst_item = new ilNewsItem($_GET["item_id"]);
     include_once "./Services/MediaObjects/classes/class.ilObjMediaObjectGUI.php";
     $mob = new ilObjMediaObject($this->mcst_item->getMobId());
     try {
         $sec = (int) $_POST["sec"];
         if ($sec < 0) {
             $sec = 0;
         }
         if ($mob->getVideoPreviewPic() != "") {
             $mob->removeAdditionalFile($mob->getVideoPreviewPic(true));
         }
         include_once "./Services/MediaObjects/classes/class.ilFFmpeg.php";
         $med = $mob->getMediaItem("Standard");
         $mob_file = ilObjMediaObject::_getDirectory($mob->getId()) . "/" . $med->getLocation();
         $new_file = ilFFmpeg::extractImage($mob_file, "mob_vpreview.png", ilObjMediaObject::_getDirectory($mob->getId()), $sec);
         if ($new_file != "") {
             ilUtil::sendInfo($this->lng->txt("mcst_image_extracted"), true);
         } else {
             ilUtil::sendFailure($this->lng->txt("mcst_no_extraction_possible"), true);
         }
     } catch (ilException $e) {
         if (DEVMODE == 1) {
             $ret = ilFFmpeg::getLastReturnValues();
             $add = is_array($ret) && count($ret) > 0 ? "<br />" . implode($ret, "<br />") : "";
         }
         ilUtil::sendFailure($e->getMessage() . $add, true);
     }
     $ilCtrl->redirect($this, "editCastItem");
 }