ffmpeg由于pid超多最大数报错(Error initializing threading)
来源:互联网 发布:码字什么软件好 编辑:程序博客网 时间:2024/05/17 23:10
ffmpeg转码转视频时出现以下情况
ffmpeg version 2.3.6 Copyright (c) 2000-2014 the FFmpeg developers
built on Mar 24 2017 11:48:29 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-52)
configuration: --enable-shared --disable-static --enable-memalign-hack --enable-libx264 --enable-gpl --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --enable-pthreads
libavutil 52. 92.100 / 52. 92.100
libavcodec 55. 69.100 / 55. 69.100
libavformat 55. 48.100 / 55. 48.100
libavdevice 55. 13.102 / 55. 13.102
libavfilter 4. 11.100 / 4. 11.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/mnt/nfs/filesRoot/microclassFile/test28.MP4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf56.36.100
Duration: 00:07:10.32, start: 0.072562, bitrate: 226 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 800x600 [SAR 30:29 DAR 40:29], 92 kb/s, 25.20 fps, 25.20 tbr, 16128 tbn, 50.40 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 22050 Hz, mono, fltp, 127 kb/s (default)
Metadata:
handler_name : SoundHandler
[AVFilterGraph @ 0xbc62a0] Error initializing threading.
[AVFilterGraph @ 0xbc62a0] Error creating filter 'null'
Error opening filters!
由于linux的pid超过最大的数导致ffmpeg无资源可用。
解决办法:
首先在转码命令中加入参数 -thread (参考:http://ffmpeg.org/ffmpeg.html)
ffmpeg -i $original -threads:1 4 -ab 56 -ar 22050 -qscale 8 -codec:v libx264 -c:a copy -movflags faststart -r 15 -s 480*320 -y $tmp
然后修改最大的进程数
1. free 命令查看内存数
2. sysctl kernel.pid_max 查看最大进程数
3. ps -eLf | wc -l查看进程数(确认满了就修改最大值)
临时方法:
修改最大进程数后系统恢复
echo 1000000 > /proc/sys/kernel/pid_max
永久生效方法:
echo "kernel.pid_max=1000000 " >> /etc/sysctl.conf
sysctl -p
- ffmpeg由于pid超多最大数报错(Error initializing threading)
- 严重: Error initializing endpoint
- Error initializing endpoint
- Error initializing emulator
- 严重: Error initializing endpoint
- Error initializing endpoint
- solr Error initializing QueryElevationComponent.
- jsp-Error initializing endpoint
- Error initializing endpoint
- 超线程(Hyper-Threading)
- Tomcat 严重:Error initializing endpoint
- mac 出现Error initializing SparkContext
- Error 25003. Error occurred while initializing fusion
- ERROR spark.SparkContext: Error initializing SparkContext
- 多个CPU和多核CPU以及超线程(Hyper-Threading)详解
- 超线程Hyper-Threading和OpenMP
- 超线程Hyper-Threading和OpenMP
- OpenMP: 超线程Hyper-Threading和OpenMP
- vs2013快速定位一个函数或者变量或者类的快捷键
- 工厂模式-2
- MT4 Trade functions
- ST 的相关介绍
- Web开发中的"路由"是什么意思?(关键词:Web开发/路由)
- ffmpeg由于pid超多最大数报错(Error initializing threading)
- 训练结果记录
- 开源项目: FlycoTabLayout (滑动指示器)
- maven source jar
- matlab---之squeeze函数
- Spark Streaming 流计算优化记录(4)-时间都去哪儿了,关于调度与空转
- CCF 引水入城
- python pickle模块 序列化
- 找到一个学习caffe的好地方