Can anyone answer what is the error about (attached image)?

I was trying to delete some frames from a video (>1500 frames). Want to cut down the size by deleting frames that are affected by noise. Took this code from file exchange.But while running to my situational video the attached error popups. Thanks for helping

4 Commenti

Which code are you using from the File Exchange?
Surya - the error message is telling you that not enough input parameters are being supplied to aviinfo. I see this function being called from within cropavi but perhaps you are calling it yourself from your main program and not passing the single input parameter? Can you show us some of your code that leads to this error?
I directly used the code. cropavi.m, I asked my IT personnel to install the windows drivers "Windows 7 Codec Pack" just in case if nay drivers were missing in my computer.
Thanks for helping!

Accedi per commentare.

 Risposta accettata

Unfortunately that code was written for older versions of MATLAB. If you manage to get past the aviinfo problem then you would fail because it relies on aviread() which no longer exists.
I fixed the code up in a couple of places for later versions, and added a little error checking. I have enclosed the changed version. It will not work for many more releases at all, as it relies upon aviinfo() which is going away soon. As it has that dependency I also let it have a dependency on the less recommended read() method of VideoReader instead of switching it to readframe, to make it easier to position to particular frames.
I cannot promise that it works in this version; unfortunately on my system there is a problem in reading most .avi files that I will have to explore with Mathworks; because of that problem I could not test the code through to the actual reading.

8 Commenti

Thanks a lot. It opens up the right number of frames in the video. However, the images doesn't appear. It shows white area as attached. Any idea? Thanks
Try this version attached. I rewrote a bunch of it and made some bug fixes.
You can now pass the name of the file to be edited as the first argument.
Note: if you get empty controls or controls that say 9 7 3, then invoke the routine with 0 or false as the second argument (the first can be empty.) This will turn on the work-around using wingdings font instead of webdings font. The work-around is automatically enabled for Mac and Linux. If that still does not work then try installing webdings and wingdings font... if that still does not work then get back to me and I'll toss in a work-around.
Thanks a lot for this great help. I tried to run the code. got this error:
Error using nargin
You can only call nargin/nargout from within a MATLAB function.
You must have commented out the first line, the "function" line. The code needs to be a function, as it calls itself.
Error using fopen The file name contains characters that are not contained in the filesystem encoding. Certain operations may not work as expected.
Error in aviinfo (line 85) fid = fopen(filename,'r','l');
Error in MBs (line 72) playvals.framedir = aviinfo( fullname );
Please put in a breakpoint at the line
playvals.framedir = aviinfo(fullfile(playvals.pathname, playvals.filename));
and run. When you get to the breakpoint, please show the output of
fprintf('LANG = "%s"\n', getenv('LANG'));
fprintf('pathname = "%s"\n', playvals.pathname );
double(playvals.pathname)
fprintf('filename = "%s"\n', playvals.filename );
double(playvals.filename)
on the aviinfo() line img1 and next line img2 attached.
Could not go to fprintf().
When you reach the breakpoint, type those fprintf() in at the command line and report the results.

Accedi per commentare.

Più risposte (0)

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by