Recherche avancée

Médias (1)

Mot : - Tags -/Christian Nold

Autres articles (107)

  • Demande de création d’un canal

    12 mars 2010, par

    En fonction de la configuration de la plateforme, l’utilisateur peu avoir à sa disposition deux méthodes différentes de demande de création de canal. La première est au moment de son inscription, la seconde, après son inscription en remplissant un formulaire de demande.
    Les deux manières demandent les mêmes choses fonctionnent à peu près de la même manière, le futur utilisateur doit remplir une série de champ de formulaire permettant tout d’abord aux administrateurs d’avoir des informations quant à (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • La file d’attente de SPIPmotion

    28 novembre 2010, par

    Une file d’attente stockée dans la base de donnée
    Lors de son installation, SPIPmotion crée une nouvelle table dans la base de donnée intitulée spip_spipmotion_attentes.
    Cette nouvelle table est constituée des champs suivants : id_spipmotion_attente, l’identifiant numérique unique de la tâche à traiter ; id_document, l’identifiant numérique du document original à encoder ; id_objet l’identifiant unique de l’objet auquel le document encodé devra être attaché automatiquement ; objet, le type d’objet auquel (...)

Sur d’autres sites (12256)

  • Having problem in video stegano, the hiden message always lost

    5 avril 2022, par user7025125

    friend, i am currently looking for a way to video stegano. I successfully in splitting frames from video file and hide messages inside them. But when i combine these frames into video and trying to extract info from the hiden video, i always failed. I guess here is problem with video compression.

    


    Here is my code.

    


    from stegano import lsb
from os.path import isfile, join

import time  # install time ,opencv,numpy modules
import cv2
import numpy as np
import math
import os
import shutil
from moviepy.editor import *
from subprocess import call, STDOUT


def split_string(s_str, count=10):
    per_c = math.ceil(len(s_str)/count)
    c_cout = 0
    out_str = ''
    split_list = []
    for s in s_str:
        out_str += s
        c_cout += 1
        if c_cout == per_c:
            split_list.append(out_str)
            out_str = ''
            c_cout = 0
    if c_cout != 0:
        split_list.append(out_str)
    return split_list


def frame_extraction(video):
    if not os.path.exists("./tmp"):
        os.makedirs("tmp")    
    temp_folder = "./tmp"
    print("[INFO] tmp directory is created")

    vidcap = cv2.VideoCapture(video)
    count = 0

    while True:
        success, image = vidcap.read()
        if not success:
            break
        cv2.imwrite(os.path.join(temp_folder, "{:d}.png".format(count)), image)
        count += 1
        print("[INFO] frame {} is extracted".format(count))


def encode_string(input_string, root="./tmp/"):
    split_string_list = split_string(input_string)
    for i in range(0, len(split_string_list)):
        f_name = "{}{}.png".format(root, i)
        secret_enc = lsb.hide(f_name, split_string_list[i])
        secret_enc.save(f_name)
        print("[INFO] frame {} holds {}".format(f_name, lsb.reveal(f_name)))


def decode_string(video):
    frame_extraction(video)
    secret = []
    root = "./tmp/"
    for i in range(len(os.listdir(root))):
        f_name = "{}{}.png".format(root, i)
        print("[INFO] frame {} is decoding".format(f_name))
        secret_dec = lsb.reveal(f_name)
        if secret_dec == None:
            break
        secret.append(secret_dec)
    print("[INFO] secret is {}".format("".join(secret)))
    print(''.join([i for i in secret]))
    # clean_tmp()


def clean_tmp(path="./tmp"):
    if os.path.exists(path):
        shutil.rmtree(path)
        print("[INFO] tmp files are cleaned up")


def main():
    input_string = input("Enter the input string: ")
    f_name = input("enter the name of video: ")

    # 从源文件分离出帧
    frame_extraction(f_name)
    
    # 分离文件路径和扩展名
    file_path, file_extraction = os.path.splitext(f_name)
    
    # 创建输出音频文件
    audio_path = file_path + "_temp.mp3"
    video = VideoFileClip(f_name)
    video.audio.write_audiofile(audio_path)

    # 加密字符
    encode_string(input_string)

    # 从tmp文件夹的图片创建没有声音的视频
    fps=30
    img_root = r"./tmp/"
    # fourcc = cv2.VideoWriter_fourcc(*'mp4v')
    fourcc = cv2.VideoWriter_fourcc(*'XVID')
    video_file_path = file_path + "_temp.avi"
    # 获取tmp文件夹第一张视频的尺寸
    img = cv2.imread(img_root + "0.png")
    height, width, layers = img.shape
    size=(width,height)
    videoWriter = cv2.VideoWriter(video_file_path,fourcc=fourcc,fps=fps,frameSize=size)
    for i in range(len(os.listdir(img_root))):
        frame = cv2.imread(img_root+str(i)+'.png')
        videoWriter.write(frame)
    videoWriter.release()

    # 合并视频和音频     audio_path   video_file_path
    video = VideoFileClip(video_file_path)
    audio_clip = AudioFileClip(audio_path)
    video = video.set_audio(audio_clip)
    video.write_videofile(file_path + "_hide.avi")
    clean_tmp()


if __name__ == "__main__":
    while True:
        print("1.Hide a message in video 2.Reveal the secret from video")
        print("any other value to exit")
        choice = input()
        if choice == '1':
            main()
        elif choice == '2':
            decode_string(input("enter the name of video with extension: "))
        else:
            break



    


    I have tried mp4, avi, wov format. But none of them worked.

    


    IF YOU HAVE ANY IDEA OR SUGGESTION GIVEN TO ME, I WOULD BE VERY GRATEFUL

    


  • Android transplant FFmpeg, call libffmpeg.so function appears ffmpeg.c : 8 : error : undefined reference to 'avcodec_version'

    24 avril 2015, par user4827738

    I need to use FFmpeg on Android, I use the FFmpeg compiled [ffmpeg for
    android][1] got libffmpeg.so, I will put the NDK libffmpeg.so
    platforms\android-8\arch-arm\usr\lib and several in the same
    directory, the script file on the
    platforms\android-8\arch-arm\usr\include directory, and then
    reference the way I wrote on the network Android.mk file, call
    avcodec_version in C code () ; function, and then prompts ffmpeg.c : 8 :
    error : undefined reference to ’avcodec_version, please help me, I’m on
    windows7 and ubuntu 14.04 are compiled, without success,thank you very
    much !

    android.mk code content

    LOCAL_PATH := $(call my-dir)

    include $(CLEAR_VARS)
    PATH_TO_FFMPEG := $(LOCAL_PATH)/ffmpeg
    LOCAL_C_INCLUDE += $(PATH_TO_FFMPEG)
    LOCAL_STATIC_LIBRARIES := -lffmpeg
    LOCAL_MODULE    := ffmpeg
    LOCAL_MODULE    := hello-ffmpeg
    LOCAL_SRC_FILES := ffmpeg.c

    include $(BUILD_SHARED_LIBRARY)

    libffmpeg.so code calls the function

    #include
    #include
    #include
    #include <libavcodec></libavcodec>avcodec.h>
    JNIEXPORT void JNICALL Java_cn_znv_ffmpeg_FFmpegNative_getVersion(JNIEnv * env, jobject obj){
    avcodec_version();
    }

    error message when ndk-build

    E:\EasyCam\HLS\FFmpeg01\jni>ndk-build "Compile thumb : hello-ffmpeg &lt;= ffmpeg.c
    SharedLibrary  : libhello-ffmpeg.so
    D:/AndroidEditor/android/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/pre
    built/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-li
    nux-androideabi/bin/ld.exe: E:/EasyCam/HLS/FFmpeg01//obj/local/armeabi/objs/hell
    o-ffmpeg/ffmpeg.o: in function Java_cn_znv_ffmpeg_FFmpegNative_getVersion:E:/Eas
    yCam/HLS/FFmpeg01//jni/ffmpeg.c:8: error: undefined reference to 'avcodec_version'

    collect2: ld returned 1 exit status
    make: *** [E:/EasyCam/HLS/FFmpeg01//obj/local/armeabi/libhello-ffmpeg.so] Error 1
  • Opening the ALSA microphone port using libavformat

    17 mai 2013, par Kartik Aiyer

    I'm writing a fairly simple application to open the microphone port using the ALSA format on a linux VM. I'm trying to do this using libavformat and other ffmpeg libs ( avutil, avcodec, etc ).

    I followed what ffmpeg was doing ( ffmpeg_opt.c : open_input_file) to open the actual microphone port( hw:0,0). I find the ALSA format using av_find_input_format( "alsa" ) which returns with a AVInputFormat* object.

    I then use this with avformat_open_input.
    I didn't precreate AVFormatContext and load it with any params before the above call ( I rely on it being created in avformat_open_input). This worked and I was able to read packets of the port. However, after a while I was not able to open the port. I added a bunch of debug in the libs and find out that :
    avformat_open_input -> init_input -> ... -> avio_open2 -> ffurl_open ->ffurl_alloc
    the final call to ffurl_alloc goes through all the protocols and tries to see if hw matches any given protocol. This fails.

    I was wondering if anyone has tried opening a mic with the ALSA format using libavformat and other libs, and if they have any tips on how to get this done. Specifically how does ffmpeg translate something like hw:0,0 to the actual device port ?

    P.S : I tried the following line on the command line app
    ffmpeg -f alsa -i hw:0,0 -ac 2 -acodec pcm_s16le output.aac
    this worked for a while and then suddenly stopped working as well with the same kind of problem. Unable to open the protocol.

    I'm not sure what changed and why its not able to open the audio port, but any advice on how also port are opened with the rather different handle of HW:x,x would be much appreciated.

    Alternatively, I realize ffmpeg is a little heavy to just read PCM packets and then encode and I could use a more direct approach by using the aac libs directly. Can anyone recommend a lib or kernel driver that I can use to open the microphone ( given that it is an ALSA card )and read PCM data out of it. ( I'm new to LInux so please forgive me if any of this sounds trivial )

    Thanks
    Kartik