Problem in video file reconstruction change its sample rate how to solve it?
조회 수: 2 (최근 30일)
이전 댓글 표시
After splitting video in audio and frames i performed some processing on audio data then i reconstruct the file but the problem is that when i am try to rewrite video its sampling rate of audio changed e-g before writing it is 44100 and video size 99.8 MB after rewriting its sampling rate is 44025 and video size is 99.3 MB due to this error my data hiding bits are changed and data can not be recovered.How i am solve this problem how to set exact sampling rate when rewriting video file? code that i am used for video rewriting are following:
VidObj=VideoReader(path);
n=VidObj.NumberOfFrames;
videoFReader = vision.VideoFileReader(path);
videoFWriter = vision.VideoFileWriter(fnn,... 'AudioInputPort',1,'AudioDataType','int16','FileFormat','avi',... 'FrameRate',videoFReader.info.VideoFrameRate);
[audio,fs]=wavread(Fn);
op=floor(fs/videoFReader.info.VideoFrameRate);
val = size(audio,1)/n;
for i=1:n
videoFrame= step(videoFReader);
% audios=audio( (i-1)*op + 1 : i*op , : );
step(videoFWriter, videoFrame,audio(val*(n-1)+1:val*n,:));
end
댓글 수: 0
답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!