vsumm-reinforce
vsumm-reinforce copied to clipboard
Questions about according to the frame of video
when I run the command:
python summary2video.py -p log/summe-split0/result.h5 -d video_frames/ -i 0 --fps 30 --save-dir log --save-name summary.mp4
this occured:
OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)'
OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v'
Traceback (most recent call last):
File "summary2video.py", line 43, in
when I run the command: python summary2video.py -p log/summe-split0/result.h5 -d video_frames/ -i 0 --fps 30 --save-dir log --save-name summary.mp4 this occured: OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v' Traceback (most recent call last): File "summary2video.py", line 43, in frm2video(args.frm_dir, summary, vid_writer) File "summary2video.py", line 27, in frm2video frm = cv2.resize(frm, (args.width, args.height)) cv2.error: OpenCV(3.4.3) /io/opencv/modules/imgproc/src/resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'resize' My generation is to use ffepeg operation video frame,One of my format is generated according to the requirements of the code format, why such a mistake?Can you help me?
Excuse me, have you solved this problem? Can you leave a mailbox to communicate with me? I also met you with this problem. Thank you very much.
Did you have frames of datasets? "summary2video.py" generate to summary video from each frames.
if you have extracted video frame ,you could try to modify 'MP4V' to 'mp4v' in code ,it shoud be work
@harvestlamb Hi~!!
import cv2
import os
video_writer = cv2.VideoWriter(os.path.join(output_path, file_name),
cv2.VideoWriter_fourcc(*'mp4v'),
fps = 30,
size = (1280, 720) )
image_list = os.listdir("image_dir")
image_list.sort()
for image_file in image_list:
frame = cv2.imread(os.path.join("image_dir", image_file))
video_writer.write(frame)
I think that this code convert images to video(30fps). I didn't test. just my idea.
when I run the command: python summary2video.py -p log/summe-split0/result.h5 -d video_frames/ -i 0 --fps 30 --save-dir log --save-name summary.mp4 this occured: OpenCV: FFMPEG: tag 0x5634504d/'MP4V' is not supported with codec id 12 and format 'mp4 / MP4 (MPEG-4 Part 14)' OpenCV: FFMPEG: fallback to use tag 0x7634706d/'mp4v' Traceback (most recent call last): File "summary2video.py", line 43, in frm2video(args.frm_dir, summary, vid_writer) File "summary2video.py", line 27, in frm2video frm = cv2.resize(frm, (args.width, args.height)) cv2.error: OpenCV(3.4.3) /io/opencv/modules/imgproc/src/resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'resize' My generation is to use ffepeg operation video frame,One of my format is generated according to the requirements of the code format, why such a mistake?Can you help me?
I have the same problem, did you resolved it? can you help me? Thank you.
Hi, @lllllmaster-lulllll.
- Download SumMe Original Dataset.
- Convert videos of Dataset to frames.
you can create a summarized video.
!python ./pytorch-vsumm-reinforce/summary2video.py -p log/summe-split0/result.h5 -d vsummary/video_frames -i 0 --fps 30 --save-dir log --save-name summary.mp4
/content/pytorch-vsumm-reinforce/summary2video.py(34)
() -> if not osp.exists(args.save_dir): (Pdb) c Traceback (most recent call last): File "./pytorch-vsumm-reinforce/summary2video.py", line 34, in if not osp.exists(args.save_dir): File "./pytorch-vsumm-reinforce/summary2video.py", line 29, in frm2video frm = cv2.resize(frm, (args.width, args.height)) cv2.error: OpenCV(3.4.3) /io/opencv/modules/imgproc/src/resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
Still getting the same errors as listed, downloaded the video files converted to .jpg kept under vsummary/video_frames still getting the same errors.
Hi, @VinACE.
please check file name.
frm_name = str(idx+1).zfill(6) + '.jpg'
As you know, Error message is that image was not read. so, assertion failed. empty(). check whether correctly read file or not.
!python ./pytorch-vsumm-reinforce/summary2video.py -p log/summe-split0/result.h5 -d vsummary/video_frames -i 0 --fps 30 --save-dir log --save-name summary.mp4
/content/pytorch-vsumm-reinforce/summary2video.py(34)
() -> if not osp.exists(args.save_dir): (Pdb) c Traceback (most recent call last): File "./pytorch-vsumm-reinforce/summary2video.py", line 34, in if not osp.exists(args.save_dir): File "./pytorch-vsumm-reinforce/summary2video.py", line 29, in frm2video frm = cv2.resize(frm, (args.width, args.height)) cv2.error: OpenCV(3.4.3) /io/opencv/modules/imgproc/src/resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'resize'
Still getting the same errors as listed, downloaded the video files converted to .jpg kept under vsummary/video_frames still getting the same errors. fourcc = cv2.VideoWriter_fourcc(*'mp4v') vid_writer = cv2.VideoWriter( 'vsummary.mp4', fourcc, 30, (1280, 720))
frm = cv2.resize(frm, (args.width, args.height)) cv2.error: OpenCV(3.4.3) /io/opencv/modules/imgproc/src/resize.cpp:4044: error: (-215:Assertion failed) !ssize.empty() in function 'resize' still the same issue.
Hi, @VinACE. Please check there is data in "frm" variable. i think don't read image file. use debugging or print(frm)
Thank you for the response, The frame I checked, vsummary/video_frames/003213.jpg -- this was available as part of the video 1 that is video 21 in VSumm dataset that I download, vsummary/video_frames/003460.jpg -- this frame was not there as it is exceeding the number of frames I had converted the video to frame and kept in vsummary/video_frames ( a location).
can I get a mapping of the VSUMM dataset to the dataset summary that is being trained or for video 1 should I also convert the other 2 video part of the 3 segments mentioned in the VSUMM dataset. (I am trying to understand like in the VSUMM dataset the numbers are like v21, how are these mapped to the training in the current code base)
ok. After converting the 3 video v21-v23, I did get the empty frame assertion error, checking further.. got the summary for the video 1-3 cv2.VideoWriter_fourcc(*'mp4v'), also helped.
ok. After converting the 3 video v21-v23, I did get the empty frame assertion error, checking further.. got the summary for the video 1-3 cv2.VideoWriter_fourcc(*'mp4v'), also helped.
I don't under stand this solution. Can you tell me more about it?