ffmpeg: 资源暂时不可用

4

我想在Linux服务器上运行FFmpeg(从 uname -a获取信息):

Linux comp32 2.6.32-279.14.1.el6.x86_64 #1 SMP Tue Nov 6 11:21:14 CST 2012 x86_64 x86_64 x86_64 GNU/Linux

ffmpeg(连同所需的编码器和解码器)在系统上成功编译,但是当我尝试执行基本操作时,例如以下操作:ffmpeg -v debug -i example.m4v image%d.jpg,我会收到一个有点晦涩的错误信息:

ffmpeg version 2.8.1 Copyright (c) 2000-2015 the FFmpeg developers
built with gcc 4.7.1 (GCC)
configuration: --prefix=/users/albanie/local/usr
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
libswscale      3.  1.101 /  3.  1.101
libswresample   1.  2.101 /  1.  2.101
Splitting the commandline.
Reading option '-v' ... matched as option 'v' (set logging level) with argument 'debug'.
Reading option '-i' ... matched as input file with argument 'example.m4v'.
Reading option 'image%d.jpg' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option v (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input file example.m4v.
Successfully parsed a group of options.
Opening an input file: example.m4v.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ee2380] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ee2380] ISO: File Type Major Brand: M4V
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ee2380] Before avformat_find_stream_info() pos: 185580655 bytes read:927102 seeks:1
[h264 @ 0x2ee3720] no picture
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ee2380] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ee2380] After avformat_find_stream_info() pos: 24214 bytes read:959870 seeks:2 frames:3
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'example.m4v':
Metadata:
  major_brand     : M4V
  minor_version   : 512
  compatible_brands: isomiso2avc1
  encoder         : Lavf56.25.101
Duration: 00:13:47.93, start: 0.033333, bitrate: 1793 kb/s
Stream #0:0(und), 2, 1/30000: Video: h264 (High), 4 reference frames (avc1 / 0x31637661), yuv420p(left), 720x576 [SAR 64:45 DAR 16:9], 1001/60000, 1656 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Metadata:
  handler_name    : VideoHandler
Stream #0:1(eng), 1, 1/48000: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 128 kb/s (default)
Metadata:
  handler_name    : SoundHandler
Successfully opened the file.
Parsing a group of options: output file image%d.jpg.
Successfully parsed a group of options.
Opening an output file: image%d.jpg.
Successfully opened the file.
detected 32 logical cores
[graph 0 input from stream 0:0 @ 0x303f7c0] Setting 'video_size' to value '720x576'
[graph 0 input from stream 0:0 @ 0x303f7c0] Setting 'pix_fmt' to value '0'
[graph 0 input from stream 0:0 @ 0x303f7c0] Setting 'time_base' to value '1/30000'
[graph 0 input from stream 0:0 @ 0x303f7c0] Setting 'pixel_aspect' to value '64/45'
[graph 0 input from stream 0:0 @ 0x303f7c0] Setting 'sws_param' to value 'flags=2'
[graph 0 input from stream 0:0 @ 0x303f7c0] Setting 'frame_rate' to value '30000/1001'
[graph 0 input from stream 0:0 @ 0x303f7c0] w:720 h:576 pixfmt:yuv420p tb:1/30000 fr:30000/1001 sar:64/45 sws_param:flags=2
[format @ 0x2f750c0] compat: called with args=[yuvj420p|yuvj422p|yuvj444p]
[format @ 0x2f750c0] Setting 'pix_fmts' to value 'yuvj420p|yuvj422p|yuvj444p'
[auto-inserted scaler 0 @ 0x2f75f00] Setting 'flags' to value 'bicubic'
[auto-inserted scaler 0 @ 0x2f75f00] w:iw h:ih flags:'bicubic' interl:0
[format @ 0x2f750c0] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
[AVFilterGraph @ 0x303f720] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
[auto-inserted scaler 0 @ 0x2f75f00] picking yuvj420p out of 3 ref:yuv420p alpha:0
[swscaler @ 0x2f664a0] deprecated pixel format used, make sure you did set range correctly
[auto-inserted scaler 0 @ 0x2f75f00] w:720 h:576 fmt:yuv420p sar:64/45 -> w:720 h:576 fmt:yuvj420p sar:64/45 flags:0x4
[mjpeg @ 0x2ee96c0] Forcing thread count to 1 for MJPEG encoding, use -thread_type slice or a constant quantizer if you want to use multiple cpu cores
[mjpeg @ 0x2ee96c0] intra_quant_bias = 96 inter_quant_bias = 0
Output #0, image2, to 'image%d.jpg':
Metadata:
  major_brand     : M4V
  minor_version   : 512
  compatible_brands: isomiso2avc1
  encoder         : Lavf56.25.101
Stream #0:0(und), 0, 1001/30000: Video: mjpeg, 1 reference frame, yuvj420p(pc, left), 720x576 [SAR 64:45 DAR 16:9], 1001/30000, q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc (default)
Metadata:
  handler_name    : VideoHandler
  encoder         : Lavc56.60.100 mjpeg
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Error while opening decoder for input stream #0:0 : Resource temporarily unavailable
[AVIOContext @ 0x2eeaee0] Statistics: 959870 bytes read, 2 seeks

我还尝试使用从这里下载的静态构建版本ffmpeg,但是仍然收到相同的“资源暂时不可用”的消息。 有没有什么想法可以解决这个问题呢?


作为更新,我还尝试了使用“-thread_type slice”的建议,这使得错误变为:无法打开输入流#0:0的解码器:操作不允许 - Cabbage soup
1个回答

7
我已经明白了——这不是ffmpeg问题,而是一个“系统”问题。我在集群的计算节点上运行,该节点(悄悄地)强制执行单线程代码。通过将命令更改为包括一个额外的标志-threads 1,我成功地让ffmpeg运行了,所以命令变成了:
ffmpeg -threads 1 -i example.m4v image%d.jpg

希望这对遇到同样困扰的人有所帮助。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接