我希望有人可以帮助我,当在python中使用FFMPEG从.mp4文件中提取关键帧时,我收到此错误:
C:\Python27\python.exe "C:/Coll. Detection/UAS_Detection/GUI.py"
in GUI main
('filePath', PyQt4.QtCore.QString(u'C:\\Users\\Razor\\Downloads\\video_test_512kb.mp4'), '\n')
File Path -> C:\Users\Razor\Downloads\video_test_512kb.mp4
SingleDetect C:\Users\Razor\Downloads\video_test_512kb.mp4
ffmpeg version N-84679-gd65b595 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 6.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
libavutil 55. 51.100 / 55. 51.100
libavcodec 57. 86.103 / 57. 86.103
libavformat 57. 67.100 / 57. 67.100
libavdevice 57. 3.101 / 57. 3.101
libavfilter 6. 78.100 / 6. 78.100
libswscale 4. 3.101 / 4. 3.101
libswresample 2. 4.100 / 2. 4.100
libpostproc 54. 2.100 / 54. 2.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\Razor\Downloads\video_test_512kb.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41
creation_time : 1970-01-01T00:00:00.000000Z
title : test file mp4 - http://www.archive.org/details/Pbtestfilemp4videotestmp4
encoder : Lavf51.10.0
comment : license: http://creativecommons.org/licenses/by-nc-sa/2.5/
Duration: 00:00:16.27, start: 0.000000, bitrate: 562 kb/s
Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 320x240 [SAR 1:1 DAR 4:3], 512 kb/s, 15 fps, 15 tbr, 15 tbn, 30 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 45 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> mjpeg (native))
Press [q] to stop, [?] for help
[swscaler @ 0000000003500e00] deprecated pixel format used, make sure you did set range correctly
Output #0, image2, to 'tmp/%d.jpeg':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: mp41
comment : license: http://creativecommons.org/licenses/by-nc-sa/2.5/
title : test file mp4 - http://www.archive.org/details/Pbtestfilemp4videotestmp4
encoder : Lavf57.67.100
Stream #0:0(und): Video: mjpeg, yuvj420p(pc), 320x240 [SAR 1:1 DAR 4:3], q=2-31, 200 kb/s, 15 fps, 15 tbn, 15 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
encoder : Lavc57.86.103 mjpeg
Side data:
cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1
2017-04-02 18:36:07.832000
Traceback (most recent call last):
File "Detection.py", line 59, in <module>
draw_detections(frame, found)
File "Detection.py", line 32, in draw_detections
result = Result.objects.create(picture=img, x=x, y=y, w=w, h=h)
AttributeError: type object 'Result' has no attribute 'objects'
frame= 21 fps=0.0 q=19.3 Lsize=N/A time=00:00:16.06 bitrate=N/A speed= 191x
video:160kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
Process finished with exit code 0
我试图通过opencv人形识别api运行这些关键帧。它将近300个关键帧保存到我指定的文件夹中,但出于某种原因,程序只是挂起来而不是在新保存的关键帧上运行open cv hogger api。如果有帮助的话会发布脚本。感谢您提供任何帮助!!!