网站首页 网站源码
website
站点相关全部源代码,隐藏了一些关于服务器的信息
[System.Console]::WriteLine('请输入视频分片存放的目录:')
$videoOutput = [System.Console]::ReadLine()
if(![System.IO.Directory]::Exists($videoOutput))
{
	[System.Console]::WriteLine('视频分片存放的目录不存在,是否创建该目录?y(es)/n(o or press any)')
	$isCreate = [System.Console]::ReadLine();
	if([System.String]::Equals("y",$isCreate, [System.StringComparison]::CurrentCultureIgnoreCase))
	{
		try
		{
			[System.IO.Directory]::CreateDirectory($videoOutput);
			[System.Console]::WriteLine("$videoOutput created")
		}
		catch [System.Exception]
		{
			[System.Console]::WriteLine($_);
		}
	}
	else
	{	
		return;
	}
}

[System.Console]::WriteLine('请输入将要分片视频文件地址:')
$videoFilePath = [System.Console]::ReadLine();
if(![System.IO.File]::Exists($videoFilePath))
{
	[System.Console]::WriteLine("$videoFilePath not exists");
	return;
}

$videoFragments = [System.IO.Path]::Combine($videoOutput , "1080p_%d.ts");
$videoIndexM3U8 = [System.IO.Path]::Combine($videoOutput , "1080p.m3u8");

ffmpeg.exe -i $videoFilePath -vf scale=w=1920:h=1080:force_original_aspect_ratio=decrease -c:a aac -ar 48000 -c:v h264 -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 $videoFragments $videoIndexM3U8
loading