Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6185863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:47:20+00:00 2026-05-24T01:47:20+00:00

I am having a problem when creating an avi file using Matlab. My aim

  • 0

I am having a problem when creating an avi file using Matlab. My aim is to use an edge filter on an entire video and save the file as an avi. The filter works fine, my problem is the writing of the avi file.

My code:

vidFile = VideoReader('video.avi');
edgeMov = avifile('edges','fps',30);

for i = 1:vidFile.numberofframes
  frameI = read(vidFile,i);
  frameIgray = rgb2gray(frameI);
  edgeI = edge(frameIgray,'canny',0.6);
  edgeIuint8 = im2uint8(edgeI);
  edgeIuint8(:,:,2) = edgeIuint8(:,:,1);
  edgeIuint8(:,:,3) = edgeIuint8(:,:,1);
  edgeMov = addframe(edgeMov,edgeIuint8);
end

edgeMov = close(edgeMov)

When the loop finishes and the avifile is closed, I go to play the video and it says “Windows Media Player encountered a problem while playing this file”. I’ve also tried, without success, Media Player Classic and VLC which lead me to believe that the problem must be the file itself. Using GSpot I checked the file and it said that the AVI header is corrupt.

Retrying the loop again returned exactly the same problem. What’s confusing me is when I run the loop for a smaller number of frames, 30 for example, the video writes fine and I can watch it. The size of the video I am trying to convert is in excess of 1000 frames so I don’t know if size is a problem?

Any help would be greatly appreciated, thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:47:22+00:00Added an answer on May 24, 2026 at 1:47 am

    I’ve used the following to create AVI

    edgeMov = avifile('video.avi','compression','Indeo5','fps',15,'quality',95); 
    

    Give it a try.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a problem writing Norwegian characters into an XML file using C#. I
I'm having a problem with creating 24/7 video player for my application on WPF
I am using MvcSiteMapProvider 2.2.1 (http://mvcsitemap.codeplex.com), and am having a problem with creating children
I am creating a simple video player but I'm having problem to show the
I'm having a problem creating a new CompositeControl. Currently I have a custom control
I've been having a problem creating a checklist in the style of the TouchCells
I am having a problem with creating a navigation controller after on the other
Having a bit of a problem creating an instance of an object. Bear in
Iam having problem creating postgresql function in plperl CREATE OR REPLACE FUNCTION zm_json (TEXT,
I'm having a problem creating a C# P/invoke wrapper around a third party C

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.