original_string: private function getStreamInformationsOfEpisode($episode)
      {
          $uri = $this->getContainer()->get('bprs.asset_helper')->getAbsoluteUrl($episode->getVideo());
          if (!$uri) { // can't create uri of episode video
              $this->logbook->error('oktolab_media.episode_assetdatajob_nourl', [], $this->args['uniqID']);
              return false;
          }
          $metadata = ['video' => false, 'audio' => false];
          try {
              $metainfo = json_decode(shell_exec(sprintf('ffprobe -v error -show_streams -print_format json %s', $uri)), true);
              foreach ($metainfo['streams'] as $stream) {
                  if ($metadata['video'] && $metadata['audio']) {
                      break;
                  }
                  if ($stream['codec_type'] == "audio") {
                      $metadata['audio'] = $stream;
                  }
                  if ($stream['codec_type'] == "video") {
                      $metadata['video'] = $stream;
                  }
              }
          } catch (Exception $e) {
              $metadata = null;
          }
  
          return $metadata;
      }
code: private function getStreamInformationsOfEpisode($episode)
      {
          $uri = $this->getContainer()->get('bprs.asset_helper')->getAbsoluteUrl($episode->getVideo());
          if (!$uri) { // can't create uri of episode video
              $this->logbook->error('oktolab_media.episode_assetdatajob_nourl', [], $this->args['uniqID']);
              return false;
          }
          $metadata = ['video' => false, 'audio' => false];
          try {
              $metainfo = json_decode(shell_exec(sprintf('ffprobe -v error -show_streams -print_format json %s', $uri)), true);
              foreach ($metainfo['streams'] as $stream) {
                  if ($metadata['video'] && $metadata['audio']) {
                      break;
                  }
                  if ($stream['codec_type'] == "audio") {
                      $metadata['audio'] = $stream;
                  }
                  if ($stream['codec_type'] == "video") {
                      $metadata['video'] = $stream;
                  }
              }
          } catch (Exception $e) {
              $metadata = null;
          }
  
          return $metadata;
      }
code_tokens: private function getStreamInformationsOfEpisode ( $ episode ) { $ uri = $ this -> getContainer ( ) -> get ( 'bprs.asset_helper' ) -> getAbsoluteUrl ( $ episode -> getVideo ( ) ) ; if ( ! $ uri ) { // can't create uri of episode video $ this -> logbook -> error ( 'oktolab_media.episode_assetdatajob_nourl' , [ ] , $ this -> args [ 'uniqID' ] ) ; return false ; } $ metadata = [ 'video' => false , 'audio' => false ] ; try { $ metainfo = json_decode ( shell_exec ( sprintf ( 'ffprobe -v error -show_streams -print_format json %s' , $ uri ) ) , true ) ; foreach ( $ metainfo [ 'streams' ] as $ stream ) { if ( $ metadata [ 'video' ] && $ metadata [ 'audio' ] ) { break ; } if ( $ stream [ 'codec_type' ] == "audio" ) { $ metadata [ 'audio' ] = $ stream ; } if ( $ stream [ 'codec_type' ] == "video" ) { $ metadata [ 'video' ] = $ stream ; } } } catch ( Exception $ e ) { $ metadata = null ; } return $ metadata ; }
docstring: extracts streaminformations of an episode from its video.
  returns false if informations can't be extracted
  returns array of video and audio info.
docstring_tokens: extracts streaminformations of an episode from its video . returns false if informations can t be extracted returns array of video and audio info .