FFMPEG av_interleaved_write_frame():不允许的操作 [英] FFMPEG av_interleaved_write_frame(): Operation not permitted
问题描述
好吧,我在尝试对MOV文件进行编码时收到"av_interleaved_write_frame():不允许操作"错误.首先,我需要概述其背后的条件.
Ok I receiving a 'av_interleaved_write_frame(): Operation not permitted' error while trying to encode an MOV file. Firstly I need to outline the conditions behind it.
我正在通过cron上运行的PHP脚本对12个不同分辨率大小和格式类型的文件进行编码.基本上,它捕获250mb HD MOV文件,并以4种不同的帧大小将其编码为MOV,MP4和WMV文件类型.
I am encoding 12 different files of different resolution sizes and format types via a PHP script that runs on cron. Basically it grabs a 250mb HD MOV file and encodes it in 4 different frame sizes as MOV, MP4 and WMV file types.
现在,脚本需要花费10分钟以上的时间来运行和编码250mb输入文件的每个文件.我正在输出处理时间,并且脚本上的时间达到10分钟时,FFMPEG崩溃,并为正在编码的当前文件和尚未编码的所有其他剩余文件返回"av_interleaved_write_frame():不允许的操作".
Now the script takes over 10mins to run and encode each of the files for the 250mb input file. I am outputting the processing times and as soon as the time on the script hits 10mins FFMPEG crashes and returns "av_interleaved_write_frame(): Operation not permitted" for the current file being encoded and all other remaining files yet to be encoded.
如果输入的视频为150MB,则脚本运行的总时间少于10分钟,因此可以对所有视频进行正确编码.此外,如果我在单个文件上运行FFMPEG命令(对于250mb文件失败),它将对文件进行编码,不会出现任何问题.
If the input videos is 150MB the total time the script runs for is under 10mins so it encodes all of the videos fine. Additionally if I run the FFMPEG command on the individual file that it fails on for the 250mb file it encodes the file with no issues.
从研究错误"av_interleaved_write_frame()"开始,看来这与我理解为输入文件的时间戳有关.但是,在我的实例中似乎并非如此,因为如果我单独进行处理,则可以毫无问题地对文件进行编码.
From doing to research on the error "av_interleaved_write_frame()" it seems it is related to timestamps of what I understand to be of the input file. But in saying that it doesn't seem to be the case in my instance because I can encode the file with no problem if I do it individually.
示例ffmpeg命令
ffmpeg -i GVowbt3vsrXL.mov -s 1920x1080 -sameq -vf "unsharp" -y GVowbt3vsrXL_4.wmv
10分钟后在失败的文件上输出错误.请记住,如果我自己运行命令,则仅在脚本运行10分钟时运行,该命令就没有问题.
Error output on the failed file at 10mins. Remember there is no issue with the command if I run it by itself it is only when the script hits 10mins.
'output' =>
array (
0 => 'FFmpeg version SVN-r24545, Copyright (c) 2000-2010 the FFmpeg developers',
1 => ' built on Aug 20 2010 23:32:02 with gcc 4.1.2 20080704 (Red Hat 4.1.2-48)',
2 => ' configuration: --enable-shared --enable-gpl --enable-pthreads --enable-nonfree --cpu=opteron --extra-cflags=\'-O3 -march=opteron -mtune=opteron\' --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-avfilter --enable-filter=movie --enable-avfilter-lavf --enable-swscale',
3 => ' libavutil 50.23. 0 / 50.23. 0',
4 => ' libavcore 0. 1. 0 / 0. 1. 0',
5 => ' libavcodec 52.84. 1 / 52.84. 1',
6 => ' libavformat 52.77. 0 / 52.77. 0',
7 => ' libavdevice 52. 2. 0 / 52. 2. 0',
8 => ' libavfilter 1.26. 1 / 1.26. 1',
9 => ' libswscale 0.11. 0 / 0.11. 0',
10 => 'Input #0, mov,mp4,m4a,3gp,3g2,mj2, from \'/home/hdfootage/public_html/process/VideoEncode/_tmpfiles/GVowbt3vsrXL/GVowbt3vsrXL.mov\':',
11 => ' Metadata:',
12 => ' major_brand : qt',
13 => ' minor_version : 537199360',
14 => ' compatible_brands: qt',
15 => ' Duration: 00:00:20.00, start: 0.000000, bitrate: 110802 kb/s',
16 => ' Stream #0.0(eng): Video: mjpeg, yuvj422p, 1920x1080 [PAR 72:72 DAR 16:9], 109386 kb/s, 25 fps, 25 tbr, 25 tbn, 25 tbc',
17 => ' Stream #0.1(eng): Audio: pcm_s16be, 44100 Hz, 2 channels, s16, 1411 kb/s',
18 => '[buffer @ 0xdcd0e0] w:1920 h:1080 pixfmt:yuvj422p',
19 => '[unsharp @ 0xe00280] auto-inserting filter \'auto-inserted scaler 0\' between the filter \'src\' and the filter \'Filter 0 unsharp\'',
20 => '[scale @ 0xe005b0] w:1920 h:1080 fmt:yuvj422p -> w:1920 h:1080 fmt:yuv420p flags:0xa0000004',
21 => '[unsharp @ 0xe00280] effect:sharpen type:luma msize_x:5 msize_y:5 amount:1.00',
22 => '[unsharp @ 0xe00280] effect:none type:chroma msize_x:0 msize_y:0 amount:0.00',
23 => 'Output #0, asf, to \'/home/hdfootage/public_html/process/VideoEncode/_tmpfiles/GVowbt3vsrXL/GVowbt3vsrXL_4.wmv\':',
24 => ' Metadata:',
25 => ' WM/EncodingSettings: Lavf52.77.0',
26 => ' Stream #0.0(eng): Video: msmpeg4, yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 1k tbn, 25 tbc',
27 => ' Stream #0.1(eng): Audio: libmp3lame, 44100 Hz, 2 channels, s16, 64 kb/s',
28 => 'Stream mapping:',
29 => ' Stream #0.0 -> #0.0',
30 => ' Stream #0.1 -> #0.1',
31 => 'Press [q] to stop encoding',
32 => '[msmpeg4 @ 0xdccb50] warning, clipping 1 dct coefficients to -127..127',
然后出错
frame= 75 fps= 5 q=1.0 size= 12704kB time=2.90 bitrate=3588 6.0kbits av_interleaved_write_frame(): Operation not permitted',
)
任何人以前都遇到过此类问题吗?似乎与时间戳有关,但这仅是因为脚本运行的时间超过了10分钟.它可能与PHP/Apache配置有关,但我不知道它是FFMPEG还是我需要查看的服务器配置.
Has any anybody encountered this sort of problem before? It seems to be something to do with the timestamps but only because the script is running for a period longer then 10mins. It maybe related to PHP/Apache config but I don't know if it is FFMPEG or if it is server config I need to be looking at.
推荐答案
此问题的一个简单可解决的原因是(如果您像我一样在搜索此问题时发现了此问题)是在尝试编写分区时文件到已满.确保您有足够的可用空间来写入文件.在linux/unix上,这就像运行
One trivially solvable cause for this problem (if you found this question while searching for this problem, as I did) is when the partition you are trying to write your file to is full. Make sure you have enough available space to write your file to. On linux/unix this is as easy as running
$ df -h
要解决此问题,只需通过将文件移动到另一个分区,删除不需要的文件并清空垃圾桶来释放足够的空间.
To solve, just free up enough space by moving files to another partition, deleting unwanted files, and emptying your trash.
这篇关于FFMPEG av_interleaved_write_frame():不允许的操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!