1

I converted a movie into array of frames with open-cv python for hiding some text information inside that with LSB steganography. I used LSB steganography to make a new array from all of them and use this array for remake first movie. But when recapture result video to image frames, I lost the data.

I tested that with extract steganography images, then used that was given true results with embedded my message to writing all of them into a video, so I'm sure that my problem is completely related to compression video methods.

I use two ways for write a video.

First way to write a video:

video_name = 'video.avi'
video = cv2.VideoWriter(video_name, 0, 1, (width,height))
for image in images:
    video.write(cv2.imread(os.path.join(image_folder, image)))

Second way:

outvid='video.avi'
fourcc = VideoWriter_fourcc(*format)
vid = None
for image in images:
    if not os.path.exists(image):
        raise FileNotFoundError(image)
    img = imread(image)
    if vid is None:
        if size is None:
            size = img.shape[1], img.shape[0]
        vid = VideoWriter(outvid, fourcc, float(fps=5), size, is_color)
    if size[0] != img.shape[1] and size[1] != img.shape[0]:
        img = resize(img, size)
    vid.write(img)
Sergey
  • 995
  • 4
  • 14
  • 33
  • video encoding typically uses lossy compression techniques to make the data size suitable for real tasks. Maybe seach for stuff like this: https://www.researchgate.net/publication/225177696_Lossy_Compression_Tolerant_Steganography – Micka Jul 30 '19 at 13:52
  • the algorithm in this paper have a nice idea but it is for a specific image with older concept of private key.i use lsb to embed message and haven't problem to extract it.but my data is lose with compression video methods when use image to make a video. – amin khoramian Jul 30 '19 at 19:40
  • that paper* @Micka – amin khoramian Jul 30 '19 at 20:13
  • The problem, as pointed out by Micka, is simple. Your two options are either to not use this algorithm with a lossy video codec, or find another algorithm which is compatible with it. – Reti43 Jul 31 '19 at 11:36
  • @Reti43 i so thanks about your help and so as Mikca,but this algorithm define in project by another – amin khoramian Aug 01 '19 at 20:39

0 Answers0