- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我尝试在具有 1 个 CPU 和 2GB RAM 的服务器上使用 ffmpeg 处理 4gb 视频,但该命令被挂起 5 分钟,然后启动并处理非常缓慢。以下是控制台输出:
命令
ffmpeg -i input.mp4 -filter_complex '[0:v]trim=823.2:867.3,setpts=PTS-STARTPTS[v0];[0:v]trim=1074.1:1101.4,setpts=PTS-STARTPTS[v1];[0:v]trim=1142.2:1198.9,setpts=PTS-STARTPTS[v2];[0:v]trim=1227.9:1320.0,setpts=PTS-STARTPTS[v3];[0:v]trim=1887.1:1990.8,setpts=PTS-STARTPTS[v4];[0:v]trim=2008.1:2091.3,setpts=PTS-STARTPTS[v5];[0:v]trim=3090.1:3105.1,setpts=PTS-STARTPTS[v6];[0:v]trim=3185.3:3222.2,setpts=PTS-STARTPTS[v7];[0:v]trim=3306.4:3336.5,setpts=PTS-STARTPTS[v8];[0:v]trim=3426.7:3465.7,setpts=PTS-STARTPTS[v9];[0:v]trim=3548.7:3586.5,setpts=PTS-STARTPTS[v10];[v0][v1][v2][v3][v4][v5][v6][v7][v8][v9][v10]concat=n=11:v=1[out]' -map '[out]' output.mp4
输出
ffmpeg version 3.4.8-0ubuntu0.2 Copyright (c) 2000-2020 the FFmpeg developers
built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/tmp/down-net_http20200902-1614-1x7tk8f.mp4':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2020-08-28T14:02:14.000000Z
Duration: 01:00:18.73, start: 0.000000, bitrate: 8895 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 8871 kb/s, 15 fps, 15 tbr, 6k tbn, 12k tbc (default)
Metadata:
creation_time : 2020-08-28T14:02:14.000000Z
handler_name : Core Media Video
Stream mapping:
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
Stream #0:0 (h264) -> trim
concat -> Stream #0:0 (libx264)
Press [q] to stop, [?] for help
[libx264 @ 0x563bd0d2c520] using SAR=1/1
[libx264 @ 0x563bd0d2c520] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x563bd0d2c520] profile High, level 3.1
[libx264 @ 0x563bd0d2c520] 264 - core 152 r2854 e9a5903 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=15 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '/opt/app/tmp/file_1599089716.mp4':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
encoder : Lavf57.83.100
Stream #0:0: Video: h264 (libx264) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], q=-1--1, 15 fps, 15360 tbn, 15 tbc (default)
Metadata:
encoder : Lavc57.107.100 libx264
Side data:
cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
frame= 0 fps=0.0 q=0.0 size= 0kB time=00:00:00.00 bitrate=N/A speed= 0x
我怎样才能提高速度?
ffmpeg -ss 823.2 -to 867.3 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 1074.1 -to 1101.4 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 1142.2 -to 1198.9 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 1227.9 -to 1320.0 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 1887.1 -to 1990.8 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 2008.1 -to 2091.3 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 3090.1 -to 3105.1 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 3185.3 -to 3222.2 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 3306.4 -to 3336.5 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 3426.7 -to 3465.7 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -ss 3548.7 -to 3586.5 -i /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -filter_complex '[0:v][1:v][2:v][3:v][4:v][5:v][6:v][7:v][8:v][9:v][10:v]concat=n=11:v=1:a=0[v]' -map '[v]' /opt/app/tmp/file_1599127170.mp4
错误
Option to (record or transcode stop time) cannot be applied to input url /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4 -- you are trying to apply an input option to an output file or vice versa. Move this option before the file it belongs to.
Error parsing options for input file /opt/app/tmp/down-net_http20200903-4776-1o4wkhk.mp4.
Error opening input files: Invalid argument
最佳答案
修剪/修剪可能很慢
trim/atrim 过滤器必须对视频进行解码,直到它达到所需的时间戳。这可能很慢。
我建议在您的 previous answer 中修剪的原因是因为您最初想使用帧(而不是时间戳)作为 trim 可以执行的单位,但是 -ss
+ -t
/-to
不能。-ss
+ -to
/-t
是比较快的
您可以使用 -ss
+ -to
/-t
输入选项以快速跳转到最近的关键帧,然后开始解码。
例子
使用 -to
:
ffmpeg -ss 823.2 -to 867.3 -i input.mp4 -ss 1074.1 -to 1101.4 -i input.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4
-to
作为输入选项需要 FFmpeg 4.0 或更高版本。或使用 -t
选项,如下所示。-filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[v]" -map "[v]" output.mp4
-t
:
ffmpeg -ss 823.2 -t 44.1 -i input.mp4 -ss 1074.1 -t 27.3 -i input.mp4 -filter_complex "[0:v][0:a][1:v][1:a]concat=n=2:v=1:a=1[v][a]" -map "[v]" -map "[a]" output.mp4
关于ffmpeg - 为什么FFMPEG过程很慢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63714902/
我有一个 view我拖了一个UITableView在里面,还有 2 UIImageView s(第一个显示背景图像,第二个只是在 View 顶部显示一个非常小的标题和图像)。 它们都设置为 weak特
我尝试用 C# 编写简单的 PostgreSQL 查询。第一个 connection.open() 需要 20 秒。其他连接立即执行。 PGAdmin 工作也很慢。如果我打开“查看所有行”,它也需要大
我制作了一个 html5 视频播放器,我注意到如果当前播放的视频有点大,搜索时间会异常地长。 越接近终点,寻找的时间越长;独立于我之前是否去过那里/与当前时间点的距离有多近,或者我是否缓冲了整个视频。
我正在使用 MaterialDatePicker,但速度很慢。 public class MainActivity extends AppCompatActivity { MaterialDa
我想知道为什么 MyBatis 是 慢 在我的应用程序中。 对于 SELECT COUNT(*) ,所用时间为: 20 秒 - 第一个请求 2-3 秒 - 后续请求 缓存很可能使后续请求更快。 配置
我已经安装了一个默认的开箱即用的 FreeSwitch 实例,但是当我尝试进行内部调用(分机到分机)时,大约需要 12 秒才能建立调用并且我可以听到铃声。 当我查看日志时,我几乎立即看到了连接请求,但
我已经放弃了让它跑得更快的实际尝试。 我最大的问题是,当我插入 html 时,应用程序会变慢到爬行。我有一个进度条,我正在调用 QCoreApplication.processEvents() (顺便
很难说出这里要问什么。这个问题模棱两可、含糊不清、不完整、过于宽泛或夸夸其谈,无法以目前的形式得到合理的回答。如需帮助澄清此问题以便重新打开,visit the help center . 关闭 9
Doxygen 在我们的代码库上运行大约需要 12 个小时。这主要是因为有很多代码要处理(约 1.5M 行)。然而,它很快就会接近我们无法进行夜间文档更新的地步,因为它们需要太长时间。我们已经不得不减
我正在重写我的旧渲染管道。我根据自己的喜好创建了一个非常精简的原型(prototype),令我震惊的是,我原来相当复杂且优化不佳的管道与 super 简单的原型(prototype)具有完全相同的性能
我想为我的网站使用 Gridster,但我需要使用“add_widget”命令添加很多小部件。我做了一个测试,我认为“add_widget”功能存在问题:网格越来越慢并且存在内存泄漏。 您可以在此视频
我有一份包含图表和表格的报告。 我正在使用 html2canvas与 jsPDF将此报告导出为 PDF 文件。 但是这个过程耗时很长,超过11000ms。 我尝试更改格式和质量,但没有任何效果。 请看
我正在查询大于时间戳的类的所有修订,使用: AuditReaderFactory .get(emf.createEntityManager()) .createQuery().forR
我最近想加速一个加密系统。而在这个系统中,它将使用mysql,因此它包括文件。 而且我发现系统运行缓慢并不是因为加解密,而是因为处理一些sql语句。 它将在运行时使用内存数据库,并使用 中的 mys
谁能看出为什么这需要大约 20 秒?我正在运行下面的代码以将 JSON 请求发布到本地服务器 192.168.1.127。 curl -H "Content-type: application/jso
我有两个表:Posts 和Tags,其中存储了用户发布的文章以及他们为文章附加的标签。 PostTags 表用于表示文章 ID 和标签 ID 的关系。结构如下: 帖子: id | title | au
一个我应该能够自己回答但我没有,而且在谷歌中也找不到任何答案的问题: 我有一个表,其中包含具有以下结构的 500 万行: CREATE TABLE IF NOT EXISTS `files_histo
以下查询在具有大约 50 万行的表上执行需要 20 多秒: SELECT images.id, images.user_id, images_locale.filename, extension, s
我正在使用 $.getJSON 来提取对象 list (100 个项目,不是一个大集合),但 XHR 调用需要 8-10 秒。 想了解我是否缺少某些内容或我可以采取哪些措施来加快我的计划? 最佳答案
在这段代码中,我从网站获取一个字符串并将其显示在标签上。在标签上显示字符串真的很慢!大约 10 秒。但是在控制台 println (date) 上打印字符串时是立即的。我该如何解决这个问题?
我是一名优秀的程序员,十分优秀!