Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about according to the frame of video #17

Open
ShaoDu opened this issue Nov 25, 2018 · 13 comments
Open

Questions about according to the frame of video #17

ShaoDu opened this issue Nov 25, 2018 · 13 comments

Comments

@ShaoDu
Copy link

ShaoDu commented Nov 25, 2018

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?

@loveFaFa
Copy link

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.

@SinDongHwan
Copy link

Did you have frames of datasets?
"summary2video.py" generate to summary video from each frames.

@harvestlamb
Copy link

harvestlamb commented Dec 9, 2019

if you have extracted video frame ,you could try to modify 'MP4V' to 'mp4v' in code ,it shoud be work

@SinDongHwan
Copy link

SinDongHwan commented Dec 9, 2019

@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.

@lllllmaster-lulllll
Copy link

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.

@SinDongHwan
Copy link

Hi, @lllllmaster-lulllll.

  1. Download SumMe Original Dataset.
  2. Convert videos of Dataset to frames.

you can create a summarized video.

@VinACE
Copy link

VinACE commented Aug 2, 2020

!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.

@SinDongHwan
Copy link

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.

@VinACE
Copy link

VinACE commented Aug 3, 2020

!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.

@SinDongHwan
Copy link

Hi, @VinACE.
Please check there is data in "frm" variable.
i think don't read image file.
use debugging or print(frm)

@VinACE
Copy link

VinACE commented Aug 4, 2020

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)

@VinACE
Copy link

VinACE commented Aug 4, 2020

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.

@subinok99
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants