我试图更好地了解FFmpeg帧率。
示例:如果我想将30 fps视频转换为23.976 fps。
选项
-framerate 24000/1001
选项
-r 24000/1001
过滤
-vf "fps=24000/1001"
x265参数
-x265-params "fps=24000/1001"
-framerate 是图像序列fps(输入视频fps?)
-vf "fps=" 正在编码fps
-r 输出fps
但是我不知道这是否正确,或者它是否会根据您将它们放在选项中的顺序而改变。
-x265-params "fps="是否需要使用自己的fps参数?不能使用默认选项吗?
应该将多个“选项”,“过滤器”和“参数”组合在一起,还是只使用一个?
输入/输出帧率
https://ffmpeg.org/ffmpeg.html#toc-Video-Options
-r[:stream_specifier] fps (input/output,per-stream)
If in doubt use -framerate instead of the input option -r.
是-r输入还是输出?如何指定,放在“ -i?” 之前还是之后?
我使用OctoberCMS基于Laravel。
我有一个后端用户,Matt在 Groupsowners中administrators。
如何检查用户是否属于特定组以允许身份验证?
有人告诉我我需要传递一个组对象,但我不知道那是什么。
use Auth;
use BackendAuth;
use Backend\Models\User;
if (BackendAuth::check()) {
// get current backend user
$backend_user = BackendAuth::getUser();
// get current backend user's groups
$backend_user_groups = Backend::getUser()->groups;
// authenticate
if ($backend_user->inGroup('administrators') {
}
}
Run Code Online (Sandbox Code Playgroud)
错误
public function inGroup($group)
Call to a member function getKey() on string
Run Code Online (Sandbox Code Playgroud)
我试过的另一种方式
if (User::inGroup('administrators') {
}
Run Code Online (Sandbox Code Playgroud)
错误
Non-static method October\Rain\Auth\Models\User::inGroup() should not be called statically
文档
https://octobercms.com/docs/backend/users
https://github.com/octobercms/library/blob/master/src/Auth/Models/User.php
我正在尝试列出当前网址部分中的网页.
{{ range $value := .Site.Sections }}
{{ range .Section }}
{{ range $value.Pages }}
<ul>
<li>{{ .Title }}</li>
</ul>
{{ end }}
{{ end }}
{{ end }}
Run Code Online (Sandbox Code Playgroud)
虽然它返回null,因为{{ range .Section }}它不是有效的代码.
这样做的正确方法是什么?
我如何将取代periods有spaces,但保留...?
string test = "This.is.a.test...";
test = test.Replace(".", " ");
Run Code Online (Sandbox Code Playgroud)
我想打印维基百科中的一些文章,但我想删除打印中所有单词的超链接下划线。
我正在使用维基百科帐户用户脚本自定义 CSS来删除链接,但无法使其工作,下划线仍然显示在 Chrome 的打印预览中。我创建了一个维基百科vector.css主题覆盖,并清除了浏览器缓存,但我无法判断 CSS 是否正在应用。
/* Remove Hyperlinks */
@media print {
a:link {text-decoration: none !important;}
a[href]:after {content: none !important;}
}
Run Code Online (Sandbox Code Playgroud)
维基百科帐户小工具打印选项
我还使用“小工具打印选项”来删除其他元素,例如参考号链接。
Chrome 打印视图
Chrome 的打印预览功能可以重新格式化页面以进行打印。
您可以在此处看到预览中带有下划线的链接。
我在命令提示符下以低优先级运行FFmpeg。
start /low /b ffmpeg -i "C:\video.mpg" -c:v libx264 -crf 25 "C:\video.mp4"
Run Code Online (Sandbox Code Playgroud)
如何在 PowerShell 中设置 FFmpeg 的优先级low, below normal, normal, above normal, high?
在 PowerShell 中使用上面的 CMD 命令,出现错误:
Parameter cannot be processed because the parameter name 'i' is ambiguous.
Start-Process : A positional parameter cannot be found that accepts argument 'ffmpeg'.
Run Code Online (Sandbox Code Playgroud)
测试解决方案
我正在尝试使用 ArcSet 答案中的第一个示例。
Start-Process ffmpeg -NoNewWindow -Wait -ArgumentList '-i "C:\video.mpg" -c:v libx264 -crf 25 "C:\video.mp4"' -PassThru Set-ProcessPriority …Run Code Online (Sandbox Code Playgroud) 我正在使用用户插件.
这是我之前关于如何拒绝用户名更改的问题.
我有一个我不希望人们使用的保留名称列表(例如admin,anonymous,guest)我需要放入一个数组并在注册时拒绝.
我的自定义组件的Plugin.php
public function boot() {
\RainLab\User\Models\User::extend(function($model) {
$model->bindEvent('model.beforeSave', function() use ($model) {
// Reserved Names List
// Deny Registering if Name in List
});
});
}
Run Code Online (Sandbox Code Playgroud)
我如何使用Validator做到这一点?
我有不同的列的列表,Name和Bitrate.
public class VideoQuality
{
public string Name { get; set; }
public string Bitrate { get; set; }
}
public List<VideoQuality> quality = new List<VideoQuality>()
{
new VideoQuality() { Name = "High", Bitrate = "5000K" },
new VideoQuality() { Name = "Medium", Bitrate = "2500K" },
new VideoQuality() { Name = "Low", Bitrate = "500K" },
};
Run Code Online (Sandbox Code Playgroud)
如何从在列表中选择Bitrate是High?
就像是:
if (selectedQuality == "High")
{
// Select High Bitrate from List
string …Run Code Online (Sandbox Code Playgroud) 这是示例代码.
我有串行星的名字,它们的顺序和颜色,通过分开spaces和NewLines.
我不想修改字符串来改变结果.
我想创建3个列表Order,Name并Color从字符串中创建.
| Order | Name | Color |
|------------|------------|------------|
| First | Mercury | Gray |
| Second | Venus | Yellow |
| Third | Earth | Blue |
| Fourth | Mars | Red |
Run Code Online (Sandbox Code Playgroud)
这将创建一个List来自string,拆分NewLine.
string planets = "First Mercury Gray"
+ Environment.NewLine
+ "Second Venus Yellow"
+ Environment.NewLine
+ "Third Earth Blue"
+ Environment.NewLine
+ "Fourth Mars …Run Code Online (Sandbox Code Playgroud) 如何循环变量并为每个变量分配一个随机字母?
无需做:
var1 = RandomLetter();
var2 = RandomLetter();
var3 = RandomLetter();
var4 = RandomLetter();
var5 = RandomLetter();
Run Code Online (Sandbox Code Playgroud)
这将产生所有具有相同的字母:
var1 = var2 = var3 = RandomLetter();
Run Code Online (Sandbox Code Playgroud)
我正在寻找缩短过程的方法,我需要对50多个变量进行此操作.
起初我虽然是一个foreach循环,但它们是null并且不会从集合中开始循环.
// Variables
public static char var1, var2, var3, var4, var5;
// Generate Random Letter
public static Random random = new Random();
public static char RandomLetter()
{
const string text = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int index = random.Next(text.Length);
return text[index];
}
Run Code Online (Sandbox Code Playgroud) 我有一个数字范围-100到100.
我正在尝试将其标准化为0带3小数位。
-100 = 0
-50 = 0.75
0 = 1.5
50 = 2.25
100 = 3
Run Code Online (Sandbox Code Playgroud)
我想创建一个程序函数来将任何范围标准化为任何值,例如:
http://rextester.com/ZJWNS24313
double Normalize(double val, double valmin, double min, double max)
{
return (val - valmin) / (max - min);
}
Run Code Online (Sandbox Code Playgroud)
然而,这并没有给出正确的输出。
100变为66.6666666666667代替3.
如果我将公式乘以小数,0.045结果是正确的。
((100 - -100) / (3 - 0)) * 0.045=3
((50 - -100) / (3 - 0)) * 0.045=2.25
((-50 - …