% Video frame Scrambling and display. % Programming: lilizong@gmai.com % 2013-9-14cd 'e: \ Copyright \ 13 years \ soft4 'clc; clear all; aviobj = avifile ('myavi \ myavi'); aviobj. quality = 100; aviobj. compression = 'none'; mov = mmreader ('myavi \ mCircle. avi '); % use mmreader to read the video file % to generate the chaotic sequence l = linspace (, mov. numberofframes); l (1) = 0.98; for I = 2: mov. numberofframes l (I) = 1-2 * l (I-1) * l (I-1); end [lsort, lindex] = sort (l ); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%obtains the scrambling video for I = 1: mov. numberofframes % get the total number of frames and read k = lindex (I), B = read (mov, k), aviobj = addframe (aviobj, B ); end % get the scrambling video % embedded pause mark for I = B = imread ('image/end.jpg '); aviobj = addframe (aviobj, B); endaviobj = close (aviobj); mplay ('myavi \ myAVI. avi ');
% The video is displayed. % Programming: lilizong@gmai.com % 2013-9-14cd 'e: \ Copyright \ 13 years \ soft4 'clc; clear all; aviobj = avifile ('myavi \ myAVI2 '); aviobj. quality = 100; aviobj. compression = 'none'; mov = mmreader ('myavi \ myAVI. avi '); % use mmreader to read the video file % to generate the chaotic sequence l = linspace (, mov. numberofframes-10); l (1) = 0.98; for I = 2: mov. numberofframes-10 l (I) = 1-2 * l (I-1) * l (I-1); end [lsort, lindex] = sort (l ); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%obtains the video [Vsort, vindex] = sort (lindex); for I = 1: mov. numberofframes-10 % to get the total number of frames and read k = Vindex (I); B = read (mov, k); aviobj = addframe (aviobj, B ); endfor I = B = imread ('image/end.jpg '); aviobj = addframe (aviobj, B); endaviobj = close (aviobj); mplay ('myavi \ myavi2.avi ');