Borrar filtros
Borrar filtros

Problem in video file reconstruction change its sample rate how to solve it?

1 visualización (últimos 30 días)
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

Respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by