全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

CeraNetworks网络延迟测速工具IP归属甄别会员请立即修改密码
查看: 3186|回复: 25

搬瓦工的VPS不能装ffmpeg么?

[复制链接]
发表于 2019-5-28 05:46:09 | 显示全部楼层 |阅读模式
本帖最后由 chow 于 2019-5-28 05:49 编辑

各位大佬,小弟最近在研究KVS系统,因为不确定KVS是否能满足自己的需求,所以先购买了一个月的使用期,在搬瓦工上弄了个4G内存的VPS测试研究系统。

结果各种KVS需要的环境安装出错,无奈只能花了99美元请KVS的官方配置服务器,到了安装配置ffmpeg的时候KVS后台一直报错,KVS技术说是服务器CPU指令集权限不够,让我找VPS的技术支持要更高的指令集权限,然后搬瓦工那边又告诉我不能提供最高的CPU指令集权限。。。。WTF,前后各种花费快小两千了,结果现在一个完整的站点还没搭起来。。。请教各位大佬,有没有在搬瓦工上完整配置过ffmpeg的?系统是CentOS 7


具体报错的错误提示如下:

nice -n 4 /usr/bin/ffmpeg -y -i /home/admin/web/xxxx.com/public_html/admin/data/plugins/audit/test_video-11577847.tmp -vcodec libx264 -movflags +faststart -threads 0 -r 25 -g 50 -crf 25 -me_method hex -trellis 0 -bf 8 -acodec aac -strict -2 -ar 44100 -ab 128k -f mp4 /home/admin/web/xxxx.com/public_html/admin/data/plugins/audit/test_video-11577847_720p.mp4 2>&1: ffmpeg version 2.8.15 Copyright (c) 2000-2018 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --extra-ldflags='-Wl,-z,relro ' --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-gnutls --enable-ladspa --enable-libass --enable-libcdio --enable-libdc1394 --enable-libfdk-aac --enable-nonfree --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libx264 --enable-libx265 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
Input #0, avi, from '/home/admin/web/xxxx.com/public_html/admin/data/plugins/audit/test_video-11577847.tmp':
Metadata:
encoder : Lavf52.78.3
Duration: 00:00:31.07, start: 0.000000, bitrate: 348 kb/s
Stream #0:0: Video: mpeg4 (Simple Profile) (FMP4 / 0x34504D46), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 270 kb/s, 23.98 fps, 23.98 tbr, 23.98 tbn, 24k tbc
Stream #0:1: Audio: mp2 (P[0][0][0] / 0x0050), 48000 Hz, stereo, s16p, 64 kb/s
ffmpeg: common/cpu.c:251: x264_cpu_detect: Assertion `!(cpu&(0x0000040|0x0000080))' failed.


KVS技术跟我说如下:

Please ask your host support to switch the processor emulation mode on this server to host-passthrough , we need this for correct works of ffmpeg library.
We need this for ffmpeg, now we see error "ffmpeg: common/cpu.c:251: x264_cpu_detect: Assertion `!(cpu&(0x0000040|0x0000080))' failed." - that's easy to switch from "QEMU Virtual CPU version (cpu64-rhel6)" to " host-passthrough" or host support can't make this?



然后搬瓦工跟我说:

Unfortunately we are not able to offer host-passthrough cpuid at this time. Do you know what specific flag ffmpeg is looking for?


崩溃中。。。




 楼主| 发表于 2019-5-28 05:47:13 | 显示全部楼层
我知道用VPS搭视频站不现实,我只是先来测试一下,看下系统如何,回头存储和转码肯定要用独立服务器的。
发表于 2019-5-28 05:47:42 | 显示全部楼层
Bwg 那破机器不能正经用的,
 楼主| 发表于 2019-5-28 05:51:36 | 显示全部楼层
googlebot2 发表于 2019-5-28 05:47
Bwg 那破机器不能正经用的,

也知道VPS可能会有权限问题,但是没想到一个站点环境都没办法搭建。。。唉。
发表于 2019-5-28 06:08:07 | 显示全部楼层
chow 发表于 2019-5-28 05:51
也知道VPS可能会有权限问题,但是没想到一个站点环境都没办法搭建。。。唉。 ...


理论上要CPU特性是因为指令集能加速转码,去掉对应参数也能转,就是速度可能会低一点

虚拟化是可以提供CPU特性的,但是因为有不同CPU指令集不同的原因,不能动态迁移,所以很多商家默认都是关的,也有一部分原因是防止挖矿,这个功能完全就看商家怎么做了
 楼主| 发表于 2019-5-28 06:20:28 | 显示全部楼层
October十月 发表于 2019-5-28 06:08
理论上要CPU特性是因为指令集能加速转码,去掉对应参数也能转,就是速度可能会低一点

虚拟化是可以提供C ...

感谢大佬回复,如果说找到ffmpeg需要具体哪条指令集,让搬瓦工客服打开对应的特性,也就可以解决了是么?
发表于 2019-5-28 07:07:37 | 显示全部楼层
瓦工只适合挂个55 正经作战换个别的吧
发表于 2019-5-28 07:36:23 | 显示全部楼层
瓦工大部分套餐都是限制CPU的,计算你装上跑一会儿就给你警告了。
发表于 2019-5-28 07:37:19 来自手机 | 显示全部楼层
这个价格。。不是可以上杜甫吗
发表于 2019-5-28 08:01:14 | 显示全部楼层
本帖最后由 0752385 于 2019-5-28 08:37 编辑

直接用二进制包不行么?
用VPS做视频站的路过

瓦工18刀款
ffmpeg参数太多,懒得一个个查是什么东西,直接复制过来
随便找了个MP4,好像没啥问题
root@localhost:~# ./ffmpeg -y -i 1.mp4 -vcodec libx264 -movflags +faststart -threads 0 -r 25 -g 50 -crf 25 -me_method hex -trellis 0 -bf 8 -acodec aac -strict -2 -ar 44100 -ab 128k -f mp4 2.mp4
ffmpeg version 4.1.1-static https://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Debian 6.3.0-18+deb9u1) 20170516
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gmp --enable-gray --enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband --enable-libsoxr --enable-libspeex --enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzvbi --enable-libzimg
  libavutil      56. 22.100 / 56. 22.100
  libavcodec     58. 35.100 / 58. 35.100
  libavformat    58. 20.100 / 58. 20.100
  libavdevice    58.  5.100 / 58.  5.100
  libavfilter     7. 40.101 /  7. 40.101
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  3.100
  libpostproc    55.  3.100 / 55.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '1.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-05-15T09:07:11.000000Z
  Duration: 00:04:10.75, start: 0.000000, bitrate: 594 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 495 kb/s, 30 fps, 30 tbr, 30 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 96 kb/s (default)
    Metadata:
      creation_time   : 2016-05-15T09:07:11.000000Z
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x5ae53c0] using SAR=1/1
[libx264 @ 0x5ae53c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x5ae53c0] profile High, level 3.0, 4:2:0, 8-bit
[libx264 @ 0x5ae53c0] 264 - core 157 r2935 545de2f - H.264/MPEG-4 AVC codec - Copyleft 2003-2018 - 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=0 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=8 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=50 keyint_min=5 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=25.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to '2.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    encoder         : Lavf58.20.100
    Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661), yuv420p(progressive), 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 25 fps, 12800 tbn, 25 tbc (default)
    Metadata:
      handler_name    : VideoHandler
      encoder         : Lavc58.35.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
    Metadata:
      creation_time   : 2016-05-15T09:07:11.000000Z
      handler_name    : IsoMedia File Produced by Google, 5-11-2011
      encoder         : Lavc58.35.100 aac
[mp4 @ 0x5ad5980] Starting second pass: moving the moov atom to the beginning of the filerop=1237 speed=3.12x   
frame= 6266 fps= 78 q=30.0 Lsize=   16483kB time=00:04:10.75 bitrate= 538.5kbits/s dup=0 drop=1251 speed=3.14x   
video:12355kB audio:3931kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.208339%
[libx264 @ 0x5ae53c0] frame I:189   Avg QP:20.80  size: 11589
[libx264 @ 0x5ae53c0] frame P:2557  Avg QP:24.81  size:  3179
[libx264 @ 0x5ae53c0] frame B:3520  Avg QP:28.35  size:   663
[libx264 @ 0x5ae53c0] consecutive B-frames: 18.3% 21.3% 18.1% 20.0% 12.0%  4.0%  2.5%  1.1%  2.6%
[libx264 @ 0x5ae53c0] mb I  I16..4: 16.9% 53.5% 29.6%
[libx264 @ 0x5ae53c0] mb P  I16..4:  6.0% 12.3%  4.2%  P16..4: 27.2%  7.0%  2.5%  0.0%  0.0%    skip:40.8%
[libx264 @ 0x5ae53c0] mb B  I16..4:  0.7%  1.1%  0.5%  B16..8: 20.8%  2.0%  0.3%  direct: 0.9%  skip:73.7%  L0:52.9% L1:44.9% BI: 2.2%
[libx264 @ 0x5ae53c0] 8x8 transform intra:53.6% inter:42.0%
[libx264 @ 0x5ae53c0] coded y,uvDC,uvAC intra: 39.2% 59.2% 17.8% inter: 3.3% 8.0% 0.2%
[libx264 @ 0x5ae53c0] i16 v,h,dc,p: 29% 32% 16% 23%
[libx264 @ 0x5ae53c0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 22% 24%  5%  4%  4%  5%  4%  6%
[libx264 @ 0x5ae53c0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 21% 16%  7%  8%  7%  7%  6%  5%
[libx264 @ 0x5ae53c0] i8c dc,h,v,p: 50% 23% 19%  8%
[libx264 @ 0x5ae53c0] Weighted P-Frames: Y:1.6% UV:1.4%
[libx264 @ 0x5ae53c0] ref P L0: 78.2%  8.2%  9.7%  3.8%  0.0%
[libx264 @ 0x5ae53c0] ref B L0: 90.8%  7.8%  1.4%
[libx264 @ 0x5ae53c0] ref B L1: 97.9%  2.1%
[libx264 @ 0x5ae53c0] kb/s:403.80
[aac @ 0x59e93c0] Qavg: 257.340
root@localhost:~#
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2024-4-19 20:28 , Processed in 0.069131 second(s), 9 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表