} // header("Content-Type: text/plain"); // print_r( get_media_info($origin_path) ); EmitErrorAndExit("ERROR: A2A conversion not supported"); // Video to Audio // // ffmpeg -i input-video.avi -vn -acodec copy output-audio.aac // -vn = no video // -acoced copy = copy the audio } else { if (($src_is_video || $file_ext == 'gif') && is_video($file_out_ext)) { // Bail if using any extra arguments (so we don't regenerate useless files) // if ($file_out_args > 0) { EmitErrorAndExit("ERROR: V2V extra args"); } // Get info about input file // $info = get_media_info($origin_path); if ($file_out_ext == 'mp4') { $out_codec = 'h264'; } else { if ($file_out_ext == 'webm') { $out_codec = 'vp9'; $alt_codec = 'vp8'; } } // header("Content-Type: text/plain"); // print_r( $info ); /* // This works, but I've disabled it so we don't bog down the server with encodes // if ( isset($out_codec) ) { // Same Codec (or compatible) //
function get_nfo($video, $release_name, $source, $sourcesrt, $imdb, $forced) { $media = get_media_info($video); #---> CODECS AUDIO <---# $ACODEC['55'] = 'MP3'; $ACODEC['6B'] = 'MP3'; $ACODEC['A_MPEG/L3'] = 'MP3'; $ACODEC['MP3'] = 'MP3'; #--> MP3 $ACODEC['40'] = 'AAC'; $ACODEC['67'] = 'AAC'; $ACODEC['AAC'] = 'AAC'; $ACODEC['A_AAC'] = 'AAC'; #--> AAC $ACODEC['A_AC3'] = 'AC3'; $ACODEC['AC-3'] = 'AC3'; $ACODEC['AC3'] = 'AC3'; #--> AC3 $ACODEC['A_DTS'] = 'DTS'; $ACODEC['DTS'] = 'DTS'; #--> DTS $ACODEC['A_FLAC'] = 'FLAC'; $ACODEC['FLAC'] = 'FLAC'; #--> FLAC $ACODEC['A_TRUEHD'] = 'TrueHD'; $ACODEC['TRUEHD'] = 'TrueHD'; #--> TrueHD $ACODEC['N/A'] = 'N/A'; $ACODEC[''] = ''; #---> VIDEO INFOS <---# if (isset($media['Video'])) { $tags['V_R'] = preg_replace('`([^0-9])`i', '', $media['Video']['width']) . " x " . preg_replace('`([^0-9])`i', '', $media['Video']['height']); } $tags['V_A'] = isset($media['Video']['display_aspect_ratio']) ? $media['Video']['display_aspect_ratio'] : 'N/A'; $tags['V_L'] = isset($media['General']['duration']) ? $media['General']['duration'] : 'N/A'; $tags['SIZE'] = isset($media['General']['file_size']) ? $media['General']['file_size'] : 'N/A'; if (isset($media['Video']['writing_library'])) { $tags['V_C'] = preg_match('/(\\w+\\s\\w+\\s\\w+)/i', $media['Video']['writing_library'], $matches) ? $matches[0] : 'x264'; } else { $tags['V_C'] = "x264"; } $tags['V_F'] = isset($media['Video']['frame_rate']) ? $media['Video']['frame_rate'] : 'N/A'; $tags['V_FP'] = isset($media['Video']['format_profile']) ? $media['Video']['format_profile'] : 'N/A'; $tags['V_B'] = isset($media['Video']['bit_rate']) ? $media['Video']['bit_rate'] : (isset($media['Video']['nominal_bit_rate']) ? $media['Video']['nominal_bit_rate'] : $media['General']['overall_bit_rate']); #---> AUDIO 1 INFOS <---# $tags['A_L'] = isset($media['Audio']['title']) ? $media['Audio']['title'] : (isset($media['Audio #1']['title']) ? $media['Audio #1']['title'] : 'ENGLiSH'); $A_C = isset($media['Audio']['codec_id']) ? $media['Audio']['codec_id'] : (isset($media['Audio #1']['codec_id']) ? $media['Audio #1']['codec_id'] : 'N/A'); $tags['A_C'] = $ACODEC[$A_C]; $tags['A_B'] = isset($media['Audio']['bit_rate']) ? $media['Audio']['bit_rate'] : (isset($media['Audio #1']['bit_rate']) ? $media['Audio #1']['bit_rate'] : '128Kbps'); $tags['A_SR'] = isset($media['Audio']['sampling_rate']) ? $media['Audio']['sampling_rate'] : (isset($media['Audio #1']['sampling_rate']) ? $media['Audio #1']['sampling_rate'] : 'N/A'); $tags['A_CH'] = isset($media['Audio']['channel(s)']) ? $media['Audio']['channel(s)'] : (isset($media['Audio #1']['channel(s)']) ? $media['Audio #1']['channel(s)'] : 'N/A'); $tags['A_MOD'] = isset($media['Audio']['compression_mode']) ? $media['Audio']['compression_mode'] : (isset($media['Audio #1']['compression_mode']) ? $media['Audio #1']['compression_mode'] : 'Lossy'); #---> AUDIO 2 INFOS <---# $A_L2 = isset($media['Audio #2']['title']) ? $media['Audio #2']['title'] : ''; $A_C2 = isset($media['Audio #2']['codec_id']) ? $media['Audio #2']['codec_id'] : ''; $tags['A_C2'] = $ACODEC[$A_C2]; $A_B2 = isset($media['Audio #2']['bit_rate']) ? $media['Audio #2']['bit_rate'] : ''; $A_SR2 = isset($media['Audio #2']['sampling_rate']) ? $media['Audio #2']['sampling_rate'] : ''; $A_CH2 = isset($media['Audio #2']['channel(s)']) ? $media['Audio #2']['channel(s)'] : ''; $A_MOD2 = isset($media['Audio #2']['compression_mode']) ? $media['Audio #2']['compression_mode'] : ''; if (isset($media['Audio #2'])) { $tags['A_L2'] = '| ' . $A_L2; $tags['A_C2'] = '| ' . $tags['A_C2']; $tags['A_B2'] = '| ' . $A_B2; $tags['A_SR2'] = '| ' . $A_SR2; $tags['A_CH2'] = '| ' . $A_CH2; $tags['A_MOD2'] = '| ' . $A_MOD2; } else { $tags['A_L2'] = $A_L2; $tags['A_C2'] = $tags['A_C2']; $tags['A_B2'] = $A_B2; $tags['A_SR2'] = $A_SR2; $tags['A_CH2'] = $A_CH2; $tags['A_MOD2'] = $A_MOD2; } #---> SUBTITLES INFOS <---# $tags['S_F'] = isset($media['Text']['format']) ? $media['Text']['format'] : (isset($media['Text #1']['format']) ? $media['Text #1']['format'] : 'N/A'); $tags['S_C'] = isset($media['Text']['codec_id']) ? $media['Text']['codec_id'] : (isset($media['Text #1']['codec_id']) ? $media['Text #1']['codec_id'] : 'N/A'); #---> RELEASE INFOS <---# $tags['DATE'] = @date('d-m-Y'); $tags['SOURCE'] = $source; $tags['SOURCESRT'] = $sourcesrt; $tags['B0'] = $imdb; $tags['TITRE_RELEASE'] = $release_name; $tags['FORCED'] = $forced; #---> WRITE NFO <---# $template = file_get_contents("app/nfo_base.nfo"); preg_match_all("/<\\!(.*?)[ ]*\\!>/", $template, $matches); foreach ($matches[1] as $key => $value) { $template_value = $tags[$value]; $taglen = strlen($matches[0][$key]); $align = STR_PAD_RIGHT; if (in_array($value, array('TITRE_RELEASE'))) { $align = STR_PAD_BOTH; } $template = str_replace($matches[0][$key], str_pad(substr($template_value, 0, $taglen), $taglen, ' ', $align), $template); } return $template; }
<body> <div id="wrapper"> <header id="header"><?php include 'functions.php'; get_media_info('title'); ?> </header> <div id="container"> <video id="media-source" width="640" height="360" poster="<?php get_media_info('poster'); ?> " preload="auto"> <source src="<?php get_media_info('source'); ?> " type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'> Current browser does not support the video tag. </video> <div id="html5-controls"> <section id="play-button" class="circle"> <div class="play"></div> <div class="pause"> <div class="bar-1"></div> <div class="bar-2"></div> </div> </section>