我正在尝试使用 ffmpeg 更改视频尺寸。例如,用户正在上传 1280*960 的视频。
我需要获得 640*480 的视频作为回报。
我试过这段代码,它的工作原理
exec($ffmpegPath." -i ".$srcFile." -ar 22050 -ab 32 -f flv -s 640x480".$destFile,$tmp);
Run Code Online (Sandbox Code Playgroud)
但是这种方法不能保持视频的宽度/高度平衡(即视频 5000*480 变成 640*480 并且从左到右看起来都被压缩了)。
在这种尺寸(5000 * 480)的情况下,我需要在出口处获取视频,例如 640 * 61 我的意思是固定高度不适合我。
我查看互联网,发现这个主题 https://superuser.com/questions/201051/resize-videos-with-different-widths-to-a-fixed-height-preserving-aspect-ratio-wi http:// delogics.blogspot.com/2011/11/ffmpeg-maintain-aspect-ratio-with-fixed.html
但它们都不适合我(ffmpeg 甚至不适用于此代码,也许我在我的 ffmpeg 字符串中添加他们的代码部分时犯了错误)
请帮助我改进我的代码
谢谢
我正试图在Windows服务器上启动yii2网站.
我的.htaccess文件:
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
Run Code Online (Sandbox Code Playgroud)
但是,当我试图将其转换为web.config文件(使用在线转换器)时,我收到这个:
<rule name="rule 1i">
<match url="." />
<action type="Rewrite" url="index.php" />
</rule>
Run Code Online (Sandbox Code Playgroud)
站点不能使用此web.config(错误500).请给我.htaccess的web.config文件