in reply to Re^4: Whats wrong with this code
in thread Whats wrong with this code

You're not fixing problems already identified in responses above, starting with the first, urging you to test your open (and, by implication, your close, too)...
open(FILE, '>Test.mp4');
which would be better written as
open(my $file, '>Test.mp4') or die "Can't open for writing, $FILE", $!;
and you just might find using strict and warnings helpful