Jump to content

lordfenixnc

+ Customer verified
  • Posts

    22
  • Joined

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

lordfenixnc's Achievements

Apprentice

Apprentice (3/14)

  • Dedicated Rare
  • Conversation Starter Rare
  • First Post Rare
  • Collaborator Rare
  • Week One Done

Recent Badges

0

Reputation

  1. I am trying to use different codes and would like to test on both JW8 and 7 without having to swap players and just use the drop down option when adding source.
  2. if you are okay with using Powershell this will take any media file in the directory and convert it to HLS and generate index file. YOU WILL NEED TO CLEAN UP THE INDEX but other than that fully automated which is nice if you Copy/paste into Notepad++ you can see which script is active and which isnt. $sw = [Diagnostics.Stopwatch]::StartNew() $files = Get-ChildItem ${Get-Location} $loco = Get-Location $p1 = Join-Path -Path $loco -ChildPath "/out" New-Item -ItemType Directory -Force -Path $p1 function lnCodeTransform { param( $String ) switch ($String) { "jpn" {"jp"} "eng" {"en"} "esp" {"es"} "fra" {"fr"} "deu" {"de"} default {$String} } } function lnNameTransform { param( $String ) switch ($String) { "jpn" {"Japanese"} "eng" {"English"} "esp" {"Spanish"} "fra" {"French"} "deu" {"German"} default {$String} } } foreach ($f in $files){ if ($f.Name -eq "out"){ continue; } $p2 = Join-Path -Path $loco -ChildPath "/out/" | Join-Path -ChildPath $f New-Item -ItemType Directory -Force -Path $p2/audio New-Item -ItemType Directory -Force -Path $p2/video New-Item -ItemType Directory -Force -Path $p2/subtitle $sb = [System.Text.StringBuilder]::new(); [void]$sb.AppendLine( '#EXTM3U' ) [void]$sb.AppendLine( '#EXT-X-VERSION:3' ) #[void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=800000,RESOLUTION=640x360' ) #[void]$sb.AppendLine( '360p.m3u8' ) New-Item -ItemType Directory -Force -Path $p2 $resStr = ffprobe -v error -select_streams v:0 -show_entries stream=height -of csv=s=x:p=0 $f.FullName; $res = [convert]::ToInt32($resStr) $audioTracks = ffprobe $f.FullName -show_entries stream=index:stream_tags=language,title -select_streams a -of compact=p=0:nk=1 $audioTracks = $audioTracks.split("\r") foreach($audio in $audioTracks) { $splited = $audio.split("|"); $ID = $splited[0] $audioName = $splited[1]; $title = $splited[2]; ffmpeg -i $f.FullName -ss 0 -y -map 0:$ID -start_number 0 -acodec aac -b:a 320k -ac 2 -f segment -segment_time 10 -segment_list_size 0 -segment_list out/$f/audio/audio_"$ID.m3u8" -segment_format mpegts out/$f/audio/"audio_$ID""_%d.ts" $name = lnNameTransform($audioName) $code = lnCodeTransform($audioName) [void]$sb.AppendLine( "#EXT-X-MEDIA:TYPE=AUDIO,GROUP-ID=`"aac`",LANGUAGE=`"$code`",NAME=`"$name ($title)`",DEFAULT=NO,AUTOSELECT=NO,URI=`"audio/audio_$ID.m3u8`"" ) } $subTracks = ffprobe $f.FullName -show_entries stream=index:stream_tags=language,title -select_streams s -of compact=p=0:nk=1 $subTracks = $subTracks.split("\r") foreach($subtitle in $subTracks) { $splited = $subtitle.split("|"); $ID = $splited[0]; $subName = $splited[1]; $title = $splited[2]; ffmpeg -i $f.FullName -ss 0 -map 0:$ID -f segment -segment_time 10 -segment_list_size 0 -segment_list out/$f/subtitle/sub_"$ID.m3u8" -segment_format webvtt -scodec webvtt out/$f/subtitle/"sub_$ID%d.vtt" $name = lnNameTransform($subName) $code = lnCodeTransform($subName) [void]$sb.AppendLine( "#EXT-X-MEDIA:TYPE=SUBTITLES,GROUP-ID=`"subs`",LANGUAGE=`"$code`",NAME=`"$name ($title)`",FORCED=NO,AUTOSELECT=NO,URI=`"subtitle/sub_$ID.m3u8`"" ) } [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=1400000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=842x480,AUDIO="aac",SUBTITLES="subs"' ) [void]$sb.AppendLine( 'video/480p.m3u8' ) #ffmpeg -i $f.FullName -c:a copy -vf scale=w=640:h=360:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 -vf scale=w=842:h=480:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 1400k -maxrate 1498k -bufsize 2100k -b:a 128k -hls_segment_filename out/$f/480p_%03d.ts out/$f/480p.m3u8 -vf scale=w=1280:h=720:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 2800k -maxrate 2996k -bufsize 4200k -b:a 128k -hls_segment_filename out/$f/720p_%03d.ts out/$f/720p.m3u8 -vf scale=w=1920:h=1080:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -gpu 1 -c:v h264_amf -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 20 -sc_threshold 0 -g 48 -keyint_min 48 -hls_time 4 -hls_playlist_type vod -b:v 5000k -maxrate 5350k -bufsize 7500k -b:a 192k -hls_segment_filename out/$f/1080p_%03d.ts out/$f/1080p.m3u8 #ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264 -profile:v main -pix_fmt yuv420p -c:a aac -filter:v scale=360:640 -ar 48000 -rc cqp -qp_p 0 -qp_i 1 -profile:v main -crf 23 -sc_threshold 0 -g 48 -b:v 800k -maxrate 856k -bufsize 1200k -b:a 96k -keyint_min 4 -start_number 0 -hls_time 10 -hls_playlist_type vod -hls_list_size 0 -f hls -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 #ffmpeg -hwaccel auto -hwaccel_device 0 -i $f.FullName -c:v h264 -profile:v main -pix_fmt yuv420p -c:a aac -filter:v scale=360:640 -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/360p_%03d.ts out/$f/360p.m3u8 #ffmpeg -i $f.FullName -c:v h264 -crf 23 -b:v 1200k -minrate 500k -maxrate 2100k -profile:v main -pix_fmt yuv420p -y -filter:v scale=-2:480 -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/480p_%03d.ts out/$f/video/480p.m3u8 ffmpeg -hwaccel qsv -i $f.FullName -c:v h264_qsv -preset slow -global_quality 30 -look_ahead 1 -profile:v main -level:v 4.1 -rc:v vbr_hq -rc-lookahead:v 32 -pix_fmt yuv420p -y -filter:v scale=-2:480 -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/480p_%03d.ts out/$f/video/480p.m3u8 If($res -ge 720) { #ffmpeg -i $f.FullName -c:v h264_qsv -crf 23 -b:v 2400k -minrate 1200k -maxrate 4200k -profile:v main -pix_fmt yuv420p -filter:v scale=-2:720 -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/720p_%03d.ts out/$f/video/720p.m3u8 ffmpeg -hwaccel qsv -i $f.FullName -c:v h264_qsv -preset slow -global_quality 28 -look_ahead 1 -profile:v main -level:v 4.1 -rc:v vbr_hq -rc-lookahead:v 32 -pix_fmt yuv420p -filter:v scale=-2:720 -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/720p_%03d.ts out/$f/video/720p.m3u8 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=2800000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=1280x720,AUDIO="aac",SUBTITLES="subs"' ) [void]$sb.AppendLine( 'video/720p.m3u8' ) } If($res -ge 900) { #ffmpeg -i $f.FullName -c:v h264 -crf 30 -b:v 4800k -minrate 2000k -maxrate 8400k -profile:v main -pix_fmt yuv420p -filter:v scale=-2:1080 -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/1080p_%03d.ts out/$f/video/1080p.m3u8 ffmpeg -hwaccel qsv -i $f.FullName -c:v h264_qsv -preset slow -global_quality 26 -look_ahead 1 -profile:v main -level:v 4.1 -rc:v vbr_hq -rc-lookahead:v 32 -pix_fmt yuv420p -filter:v scale=-2:1080 -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/1080p_%03d.ts out/$f/video/1080p.m3u8 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=5000000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=1920x1080,AUDIO="aac",SUBTITLES="subs"' ) [void]$sb.AppendLine( 'video/1080p.m3u8' ) } If($res -ge 1200) { #ffmpeg -i $f.FullName -c:v h264 -crf 30 -b:v 4800k -minrate 2000k -maxrate 8400k -profile:v main -pix_fmt yuv420p -filter:v scale=-2:1080 -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/1080p_%03d.ts out/$f/video/1080p.m3u8 ffmpeg -hwaccel qsv -i $f.FullName -c:v h264_qsv -preset slow -global_quality 24 -look_ahead 1 -profile:v main -level:v 4.1 -rc:v vbr_hq -rc-lookahead:v 32 -pix_fmt yuv420p -filter:v scale=-2:2160 -map 0:v -start_number 0 -hls_time 10 -hls_list_size 0 -f hls -hls_segment_filename out/$f/video/4k_%03d.ts out/$f/video/4k.m3u8 [void]$sb.AppendLine( '#EXT-X-STREAM-INF:BANDWIDTH=5000000,CODECS="avc1.4d4015,mp4a.40.2",RESOLUTION=3840x2160,AUDIO="aac",SUBTITLES="subs"' ) [void]$sb.AppendLine( 'video/4k.m3u8' ) } $p3 = Join-Path -Path $p2 -ChildPath "/index.m3u8" #echo $index | Out-File -Encoding UTF8 -LiteralPath $p3 echo $sb.ToString() [System.IO.File]::WriteAllLines($p3, $sb.ToString().Trim().replace("`r`n", "`n")) } $sw.Stop() echo $sw.Elapsed
  3. https://jsbin.com/xogoremuqa/edit?html,output got it working using Video.JS.
  4. I found something that is supposed to work with JWplayer to enable SSA/ASS subtitles to work. Could someone help me figure it out Heck would be great if they add it to the theme. https://github.com/libass/JavascriptSubtitlesOctopus my current player script <?php $episode_pagi = DDbmoviesHelpers::EpisodeNav($tmdbids,$temporad,$episode); $next_episode = doo_isset($episode_pagi,'next'); $link_next = !empty($next_episode) ? 'href="'.$next_episode['permalink'].'" title="'.$next_episode['title'].'"' : 'href="#" class="nonex"'; ?> <!DOCTYPE html> <html lang="en" dir="ltr" data-cast-api-enabled="true"> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="robots" content="noindex"> <title>JW Player</title> <script src='https://ssl.p.jwpcdn.com/player/v/8.6.2/jwplayer.js'></script> <script type="text/javascript">jwplayer.key="<?php echo $jw8key; ?>";</script> <script type="text/javascript"> var jw = <?php echo json_encode($data)."\n"; ?> </script> <style type="text/css" media="all"> html,body{padding:0;margin:0;height:100%} #player{width:100%!important;height:100%!important;overflow:hidden;background-color:#000} </style> </head> <body class="jwplayer"> <div id="player"></div> <script type="text/javascript"> const defaulGateway = "https://gateway.anime4all.net/ipfs/"; let gateway; if(sessionStorage.getItem("ipfsGateway")) { gateway = sessionStorage.getItem("ipfsGateway"); } else { gateway = defaulGateway; } const player = jwplayer('player').setup({ image: jw.image, mute: false, volume: 100, autostart: jw.auto, repeat: false, abouttext: jw.text, aboutlink: jw.link, skin: { active: jw.color }, logo: { file: jw.logo, hide: true, link: jw.link, margin: '15', position: jw.lposi }, sources: [{ file: gateway + "<?php echo $_GET['source'].'/index.m3u8'; ?>", type: 'video/mp4' }], "cast": {} }) player.on("complete", () => { console.log("video completed" + "<?php echo $next_episode; ?>"); window.parent.eval(() => { window.parent.location.href = window.parent.nextEpisode; })() }) </script> </body> </html>
×
×
  • Create New...