Showing posts with label video. Show all posts
Showing posts with label video. Show all posts

Monday, May 12, 2014

K-Lite Codec Pack crashes games when playing in-game videos

Several months ago, I updated the K-Lite Codec Pack and found out my game would crash when playing in-game videos. At that time, I simply uninstalled the new version, and got back the old version.

Two weeks ago, I decided to give the new version of K-Lite Codec Pack another try, and would like to see the problem has been solved. Unfortunately, nothing changed but crashing games. The FAQ on the official website of K-Lite Codec Pack provides some solutions (http://www.codecguide.com/faq_miscellaneous.htm#item1), but all failed to solve the issue.

What I suspected was that it is related to the configuration of the software. I checked the video format of the games, it is wmv videos. So I  did the following.
  1. Opened the Codec Tweak Tool that comes with K-Lite. 
  2. Clicked on the Preferred splitters (under the section of Codec and Filter Management
  3. In the pop up window, there are two columns ## 32-bit source filters ## and ## 64-bit source filters ##
  4. Found out the .wmv section (both 32-bit and 64-bit sections), changed the setting from Use merit (recommended) to LAV Splitter
Problem was solved.

***************
Update: Apri 2015
In the recent version of K-lite, you may need to change the VC-1 section instead of wmv. You can use MediaInfo tool that comes with K-lite to find out the detailed information of the game videos.

Thursday, May 10, 2007

Convert images to avi video in MATLAB

Yesterday I wrote a function that converts images in a directory to avi video based on Wu's code. Here is the simplified version.

function varargout=im2avi(ext, imdir, scale, framerate, filename, playflag)
% im2avi converts image sequenses to avi video
%
% SYNTAX
%
% Inputs: imdir: image sequense directory
% ext: the extension name of the image such as 'jpg', 'tif',
% scale: image resize, like [320 400] or 0.9
% framerate: avi video frame rate
% filename: save avi as
% playflag: play the avi video; if it is 0, no play, if >0,
% play the avi 'playflag' times.
%
% EXAMPLE: im2avi(ext, imdir, scale, framerate, filename, playflag)
%
% NOTES: based on im2avi (author: Zhe Wu @ Univ of Rochester)
% Wenbin, 09-May-2007

warning('im2avi:warning','Do NOT close or open any image window during the process!\n')

filearray=dir([imdir filesep '*.' ext]);
s=size(filearray,1);

frameind=0;
mv =struct('cdata',{}, 'colormap', {});
figure, h =gcf;

for i=1:s
frameind=frameind+1;
imgname=[imdir filesep filearray(i).name];
im=imread(imgname) ;
im=imresize(im, scale);
imshow(im);
mv(frameind)=getframe(h);
end
close(h)

movie2avi(mv, [imdir filesep filename '.avi'], 'fps', framerate);
% movie2avi(mv, [imdir filesep filename '.avi'], 'fps', framerate, 'compression', 'None');


if nargout >0
varargout{1} =mv;
end

if playflag>0
movie(mv, playflag);
end

Chinese version:

用MATLAB转换图片到avi视频

http://time360.blogspot.com/2007/05/matlabavi.html