Video Steganography, audio steganography.

7 Ansichten (letzte 30 Tage)
Toan Nguyen
Toan Nguyen am 8 Okt. 2019
Bearbeitet: Toan Nguyen am 8 Okt. 2019
Hi everyone! I hided data in audio and put it back in video(without audio), then I extracted the audio to retrieve data but i can't get any data. Please help me!
This is my code to extract audio
[input_file, Fs] = audioread('video.avi');
audiowrite('.\audio\audio.wav', input_file, Fs);
This is my code to create video without audio.
% create video without audio
vidObj = VideoReader(vidfile);
videoOut = VideoWriter('ouput1','Uncompressed AVI');
videoOut.FrameRate = vidObj.FrameRate;
open(videoOut);
while hasFrame(vidObj)
vidFrame = readFrame(vidObj);
writeVideo(videoOut,vidFrame);
end
close(videoOut);
And this is my code to merge audio and video(without audio) into stego video.
%add audio into stego video
video_filename = 'ouput1.avi';
audio_filename = '.\audio\stego_audio.wav';
out_filename = '.\stego_video\stego_audio.avi';
videoFReader = VideoReader(video_filename);
FR = videoFReader.FrameRate;
[AUDIO,Fs] = audioread(audio_filename);
SamplesPerFrame = floor(Fs/FR);
videoFWriter = vision.VideoFileWriter(out_filename, 'AudioInputPort', true, 'FrameRate', FR);
framenum = 0;
% read every frame and add audio that(every frame)
while hasFrame(videoFReader)
videoFrame = readFrame(videoFReader);
this_audio = AUDIO(framenum*SamplesPerFrame + 1 : min(end, (framenum+1)*SamplesPerFrame), :);
if size(this_audio,1) < SamplesPerFrame
this_audio(SamplesPerFrame,:) = 0; %zero pad short frames
end
step(videoFWriter,videoFrame, this_audio);
framenum = framenum + 1;
end
delete(videoFReader);
release(videoFWriter);

Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by