Recherche avancée

Médias (1)

Mot : - Tags -/pirate bay

Autres articles (101)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • Le plugin : Gestion de la mutualisation

    2 mars 2010, par

    Le plugin de Gestion de mutualisation permet de gérer les différents canaux de mediaspip depuis un site maître. Il a pour but de fournir une solution pure SPIP afin de remplacer cette ancienne solution.
    Installation basique
    On installe les fichiers de SPIP sur le serveur.
    On ajoute ensuite le plugin "mutualisation" à la racine du site comme décrit ici.
    On customise le fichier mes_options.php central comme on le souhaite. Voilà pour l’exemple celui de la plateforme mediaspip.net :
    < ?php (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

Sur d’autres sites (8841)

  • Run python ffmpeg audio convertion code file from subprocess.call() within a flask server

    11 novembre 2019, par Kasun

    I have build a small flask server to handle the request. I have 3 parameters in the api function that i want to get. those are type, user_id, audio_file, One is a file. Since it’s used for the audio file conversion. I have to get a file.. I have tested with this in Postman audio file get saved but the subprocess.call(command) in the api function doesn’t work..

    this is the flask server code

    @app.route('/voice', methods=['GET','POST'])
    def process_audio():
    try:
       if request.method == 'POST':
           input_type = request.form['type']
           user_id = request.form['user_id']
           static_file = request.files['audio_file']
           audio_name = secure_filename(static_file.filename)
           path = 't/'
           status = static_file.save(path + audio_name)
           full_file = path + audio_name
           if input_type == 1:
               cmd = "python t/convert_english.py --audio " + full_file
               res = subprocess.call([cmd],shell=True)
               f = open('t/ress.txt', 'w')
               f.write(str(res))
               f.close()
               return "true"
           else:
               cmd = "python t/convert_sinhala.py --audio " + full_file
               os.system(cmd)
               return "true"
       else:
           return "false"

    except Exception as e:
       print(e)
       logger.error(e)
       return e

    The audio file get saved in the directory as expected..

    this is the convert_english.py

    import subprocess
    import argparse
    import os
    import logging
    import speech_recognition as sr
    from tqdm import tqdm
    from multiprocessing.dummy import Pool

    #subprocess.call('pip install pydub',shell=True)

    from os import path
    from pydub import AudioSegment

    logging.basicConfig(filename='/var/www/img-p/t/ee.log', level=logging.DEBUG,
                       format='%(asctime)s %(levelname)s %(name)s %(message)s')
    logger=logging.getLogger(__name__)

    ap = argparse.ArgumentParser()
    ap.add_argument("-a", "--audio", required=True,
       help="path to input audio file")
    args = vars(ap.parse_args())

    src = args["audio"]
    dst = "audio.wav"

    sound = AudioSegment.from_mp3(src)
    sound.export(dst, format="wav")

    #subprocess.call('pip install ffmpeg-python',shell=True)

    subprocess.call('mkdir parts',shell=True)

    subprocess.call('ffmpeg -i audio.wav -f segment -segment_time 30 -c copy parts/out%09d.wav',shell=True)

    #subprocess.call('pip install SpeechRecognition',shell=True)


    pool = Pool(8) # Number of concurrent threads

    with open("api-key.json") as f:
       GOOGLE_CLOUD_SPEECH_CREDENTIALS = f.read()

    r = sr.Recognizer()
    files = sorted(os.listdir('parts/'))

    def transcribe(data):
       idx, file = data
       name = "parts/" + file
       print(name + " started")
       # Load audio file
       with sr.AudioFile(name) as source:
           audio = r.record(source)
       # Transcribe audio file
       text = r.recognize_google_cloud(audio, credentials_json=GOOGLE_CLOUD_SPEECH_CREDENTIALS)
       print(name + " done")
       return {
           "idx": idx,
           "text": text
       }

    all_text = pool.map(transcribe, enumerate(files))
    pool.close()
    pool.join()

    transcript = ""
    for t in sorted(all_text, key=lambda x: x['idx']):
       total_seconds = t['idx'] * 30
       # Cool shortcut from:
       # https://stackoverflow.com/questions/775049/python-time-seconds-to-hms
       # to get hours, minutes and seconds
       m, s = divmod(total_seconds, 60)
       h, m = divmod(m, 60)

       # Format time as h:m:s - 30 seconds of text
       transcript = transcript + "{:0>2d}:{:0>2d}:{:0>2d} {}\n".format(h, m, s, t['text'])

    print(transcript)

    with open("transcript.txt", "w") as f:
       f.write(transcript)

    f = open("transcript.txt")
    lines = f.readlines()
    f.close()
    f = open("transcript.txt", "w", encoding="utf-8")
    for line in lines:
       f.write(line[8:])
    f.close()

    The thing is above code works when i manually run the command -> python t/convert_english.py —audio t/tttttttttt.mp3 like this in the terminal..

    But when i try to run from the flask server itself it doesn’t works.. And I’m not getting an error either.

  • FFmpeg overlay positioning issue : Converting frontend center coordinates to FFmpeg top-left coordinates

    25 janvier, par tarun

    I'm building a web-based video editor where users can :

    &#xA;

    Add multiple videos&#xA;Add images&#xA;Add text overlays with background color

    &#xA;

    Frontend sends coordinates where each element's (x,y) represents its center position.&#xA;on click of the export button i want all data to be exported as one final video&#xA;on click i send the data to the backend like -

    &#xA;

     const exportAllVideos = async () => {&#xA;    try {&#xA;      const formData = new FormData();&#xA;        &#xA;      &#xA;      const normalizedVideos = videos.map(video => ({&#xA;          ...video,&#xA;          startTime: parseFloat(video.startTime),&#xA;          endTime: parseFloat(video.endTime),&#xA;          duration: parseFloat(video.duration)&#xA;      })).sort((a, b) => a.startTime - b.startTime);&#xA;&#xA;      &#xA;      for (const video of normalizedVideos) {&#xA;          const response = await fetch(video.src);&#xA;          const blobData = await response.blob();&#xA;          const file = new File([blobData], `${video.id}.mp4`, { type: "video/mp4" });&#xA;          formData.append("videos", file);&#xA;      }&#xA;&#xA;      &#xA;      const normalizedImages = images.map(image => ({&#xA;          ...image,&#xA;          startTime: parseFloat(image.startTime),&#xA;          endTime: parseFloat(image.endTime),&#xA;          x: parseInt(image.x),&#xA;          y: parseInt(image.y),&#xA;          width: parseInt(image.width),&#xA;          height: parseInt(image.height),&#xA;          opacity: parseInt(image.opacity)&#xA;      }));&#xA;&#xA;      &#xA;      for (const image of normalizedImages) {&#xA;          const response = await fetch(image.src);&#xA;          const blobData = await response.blob();&#xA;          const file = new File([blobData], `${image.id}.png`, { type: "image/png" });&#xA;          formData.append("images", file);&#xA;      }&#xA;&#xA;      &#xA;      const normalizedTexts = texts.map(text => ({&#xA;          ...text,&#xA;          startTime: parseFloat(text.startTime),&#xA;          endTime: parseFloat(text.endTime),&#xA;          x: parseInt(text.x),&#xA;          y: parseInt(text.y),&#xA;          fontSize: parseInt(text.fontSize),&#xA;          opacity: parseInt(text.opacity)&#xA;      }));&#xA;&#xA;      &#xA;      formData.append("metadata", JSON.stringify({&#xA;          videos: normalizedVideos,&#xA;          images: normalizedImages,&#xA;          texts: normalizedTexts&#xA;      }));&#xA;&#xA;      const response = await fetch("my_flask_endpoint", {&#xA;          method: "POST",&#xA;          body: formData&#xA;      });&#xA;&#xA;      if (!response.ok) {&#xA;        &#xA;          console.log(&#x27;wtf&#x27;, response);&#xA;          &#xA;      }&#xA;&#xA;      const finalVideo = await response.blob();&#xA;      const url = URL.createObjectURL(finalVideo);&#xA;      const a = document.createElement("a");&#xA;      a.href = url;&#xA;      a.download = "final_video.mp4";&#xA;      a.click();&#xA;      URL.revokeObjectURL(url);&#xA;&#xA;    } catch (e) {&#xA;      console.log(e, "err");&#xA;    }&#xA;  };&#xA;

    &#xA;

    the frontend data for each object that is text image and video we are storing it as an array of objects below is the Data strcutre for each object -

    &#xA;

    // the frontend data for each&#xA;  const newVideo = {&#xA;      id: uuidv4(),&#xA;      src: URL.createObjectURL(videoData.videoBlob),&#xA;      originalDuration: videoData.duration,&#xA;      duration: videoData.duration,&#xA;      startTime: 0,&#xA;      playbackOffset: 0,&#xA;      endTime: videoData.endTime || videoData.duration,&#xA;      isPlaying: false,&#xA;      isDragging: false,&#xA;      speed: 1,&#xA;      volume: 100,&#xA;      x: window.innerHeight / 2,&#xA;      y: window.innerHeight / 2,&#xA;      width: videoData.width,&#xA;      height: videoData.height,&#xA;    };&#xA;    const newTextObject = {&#xA;      id: uuidv4(),&#xA;      description: text,&#xA;      opacity: 100,&#xA;      x: containerWidth.width / 2,&#xA;      y: containerWidth.height / 2,&#xA;      fontSize: 18,&#xA;      duration: 20,&#xA;      endTime: 20,&#xA;      startTime: 0,&#xA;      color: "#ffffff",&#xA;      backgroundColor: hasBG,&#xA;      padding: 8,&#xA;      fontWeight: "normal",&#xA;      width: 200,&#xA;      height: 40,&#xA;    };&#xA;&#xA;    const newImage = {&#xA;      id: uuidv4(),&#xA;      src: URL.createObjectURL(imageData),&#xA;      x: containerWidth.width / 2,&#xA;      y: containerWidth.height / 2,&#xA;      width: 200,&#xA;      height: 200,&#xA;      borderRadius: 0,&#xA;      startTime: 0,&#xA;      endTime: 20,&#xA;      duration: 20,&#xA;      opacity: 100,&#xA;    };&#xA;&#xA;

    &#xA;

    BACKEND CODE -

    &#xA;

    import os&#xA;import shutil&#xA;import subprocess&#xA;from flask import Flask, request, send_file&#xA;import ffmpeg&#xA;import json&#xA;from werkzeug.utils import secure_filename&#xA;import uuid&#xA;from flask_cors import CORS&#xA;&#xA;&#xA;app = Flask(__name__)&#xA;CORS(app, resources={r"/*": {"origins": "*"}})&#xA;&#xA;&#xA;&#xA;UPLOAD_FOLDER = &#x27;temp_uploads&#x27;&#xA;if not os.path.exists(UPLOAD_FOLDER):&#xA;    os.makedirs(UPLOAD_FOLDER)&#xA;&#xA;&#xA;@app.route(&#x27;/&#x27;)&#xA;def home():&#xA;    return &#x27;Hello World&#x27;&#xA;&#xA;&#xA;OUTPUT_WIDTH = 1920&#xA;OUTPUT_HEIGHT = 1080&#xA;&#xA;&#xA;&#xA;@app.route(&#x27;/process&#x27;, methods=[&#x27;POST&#x27;])&#xA;def process_video():&#xA;    work_dir = None&#xA;    try:&#xA;        work_dir = os.path.abspath(os.path.join(UPLOAD_FOLDER, str(uuid.uuid4())))&#xA;        os.makedirs(work_dir)&#xA;        print(f"Created working directory: {work_dir}")&#xA;&#xA;        metadata = json.loads(request.form[&#x27;metadata&#x27;])&#xA;        print("Received metadata:", json.dumps(metadata, indent=2))&#xA;        &#xA;        video_paths = []&#xA;        videos = request.files.getlist(&#x27;videos&#x27;)&#xA;        for idx, video in enumerate(videos):&#xA;            filename = f"video_{idx}.mp4"&#xA;            filepath = os.path.join(work_dir, filename)&#xA;            video.save(filepath)&#xA;            if os.path.exists(filepath) and os.path.getsize(filepath) > 0:&#xA;                video_paths.append(filepath)&#xA;                print(f"Saved video to: {filepath} Size: {os.path.getsize(filepath)}")&#xA;            else:&#xA;                raise Exception(f"Failed to save video {idx}")&#xA;&#xA;        image_paths = []&#xA;        images = request.files.getlist(&#x27;images&#x27;)&#xA;        for idx, image in enumerate(images):&#xA;            filename = f"image_{idx}.png"&#xA;            filepath = os.path.join(work_dir, filename)&#xA;            image.save(filepath)&#xA;            if os.path.exists(filepath):&#xA;                image_paths.append(filepath)&#xA;                print(f"Saved image to: {filepath}")&#xA;&#xA;        output_path = os.path.join(work_dir, &#x27;output.mp4&#x27;)&#xA;&#xA;        filter_parts = []&#xA;&#xA;        base_duration = metadata["videos"][0]["duration"] if metadata["videos"] else 10&#xA;        filter_parts.append(f&#x27;color=c=black:s={OUTPUT_WIDTH}x{OUTPUT_HEIGHT}:d={base_duration}[canvas];&#x27;)&#xA;&#xA;        for idx, (path, meta) in enumerate(zip(video_paths, metadata[&#x27;videos&#x27;])):&#xA;            x_pos = int(meta.get("x", 0) - (meta.get("width", 0) / 2))&#xA;            y_pos = int(meta.get("y", 0) - (meta.get("height", 0) / 2))&#xA;            &#xA;            filter_parts.extend([&#xA;                f&#x27;[{idx}:v]setpts=PTS-STARTPTS,scale={meta.get("width", -1)}:{meta.get("height", -1)}[v{idx}];&#x27;,&#xA;                f&#x27;[{idx}:a]asetpts=PTS-STARTPTS[a{idx}];&#x27;&#xA;            ])&#xA;&#xA;            if idx == 0:&#xA;                filter_parts.append(&#xA;                    f&#x27;[canvas][v{idx}]overlay=x={x_pos}:y={y_pos}:eval=init[temp{idx}];&#x27;&#xA;                )&#xA;            else:&#xA;                filter_parts.append(&#xA;                    f&#x27;[temp{idx-1}][v{idx}]overlay=x={x_pos}:y={y_pos}:&#x27;&#xA;                    f&#x27;enable=\&#x27;between(t,{meta["startTime"]},{meta["endTime"]})\&#x27;:eval=init&#x27;&#xA;                    f&#x27;[temp{idx}];&#x27;&#xA;                )&#xA;&#xA;        last_video_temp = f&#x27;temp{len(video_paths)-1}&#x27;&#xA;&#xA;        if video_paths:&#xA;            audio_mix_parts = []&#xA;            for idx in range(len(video_paths)):&#xA;                audio_mix_parts.append(f&#x27;[a{idx}]&#x27;)&#xA;            filter_parts.append(f&#x27;{"".join(audio_mix_parts)}amix=inputs={len(video_paths)}[aout];&#x27;)&#xA;&#xA;        &#xA;        if image_paths:&#xA;            for idx, (img_path, img_meta) in enumerate(zip(image_paths, metadata[&#x27;images&#x27;])):&#xA;                input_idx = len(video_paths) &#x2B; idx&#xA;                &#xA;                &#xA;                x_pos = int(img_meta["x"] - (img_meta["width"] / 2))&#xA;                y_pos = int(img_meta["y"] - (img_meta["height"] / 2))&#xA;                &#xA;                filter_parts.extend([&#xA;                    f&#x27;[{input_idx}:v]scale={img_meta["width"]}:{img_meta["height"]}[img{idx}];&#x27;,&#xA;                    f&#x27;[{last_video_temp}][img{idx}]overlay=x={x_pos}:y={y_pos}:&#x27;&#xA;                    f&#x27;enable=\&#x27;between(t,{img_meta["startTime"]},{img_meta["endTime"]})\&#x27;:&#x27;&#xA;                    f&#x27;alpha={img_meta["opacity"]/100}[imgout{idx}];&#x27;&#xA;                ])&#xA;                last_video_temp = f&#x27;imgout{idx}&#x27;&#xA;&#xA;        if metadata.get(&#x27;texts&#x27;):&#xA;            for idx, text in enumerate(metadata[&#x27;texts&#x27;]):&#xA;                next_output = f&#x27;text{idx}&#x27; if idx &lt; len(metadata[&#x27;texts&#x27;]) - 1 else &#x27;vout&#x27;&#xA;                &#xA;                escaped_text = text["description"].replace("&#x27;", "\\&#x27;")&#xA;                &#xA;                x_pos = int(text["x"] - (text["width"] / 2))&#xA;                y_pos = int(text["y"] - (text["height"] / 2))&#xA;                &#xA;                text_filter = (&#xA;                    f&#x27;[{last_video_temp}]drawtext=text=\&#x27;{escaped_text}\&#x27;:&#x27;&#xA;                    f&#x27;x={x_pos}:y={y_pos}:&#x27;&#xA;                    f&#x27;fontsize={text["fontSize"]}:&#x27;&#xA;                    f&#x27;fontcolor={text["color"]}&#x27;&#xA;                )&#xA;                &#xA;                if text.get(&#x27;backgroundColor&#x27;):&#xA;                    text_filter &#x2B;= f&#x27;:box=1:boxcolor={text["backgroundColor"]}:boxborderw=5&#x27;&#xA;                &#xA;                if text.get(&#x27;fontWeight&#x27;) == &#x27;bold&#x27;:&#xA;                    text_filter &#x2B;= &#x27;:font=Arial-Bold&#x27;&#xA;                &#xA;                text_filter &#x2B;= (&#xA;                    f&#x27;:enable=\&#x27;between(t,{text["startTime"]},{text["endTime"]})\&#x27;&#x27;&#xA;                    f&#x27;[{next_output}];&#x27;&#xA;                )&#xA;                &#xA;                filter_parts.append(text_filter)&#xA;                last_video_temp = next_output&#xA;        else:&#xA;            filter_parts.append(f&#x27;[{last_video_temp}]null[vout];&#x27;)&#xA;&#xA;        &#xA;        filter_complex = &#x27;&#x27;.join(filter_parts)&#xA;&#xA;        &#xA;        cmd = [&#xA;            &#x27;ffmpeg&#x27;,&#xA;            *sum([[&#x27;-i&#x27;, path] for path in video_paths], []),&#xA;            *sum([[&#x27;-i&#x27;, path] for path in image_paths], []),&#xA;            &#x27;-filter_complex&#x27;, filter_complex,&#xA;            &#x27;-map&#x27;, &#x27;[vout]&#x27;&#xA;        ]&#xA;        &#xA;        &#xA;        if video_paths:&#xA;            cmd.extend([&#x27;-map&#x27;, &#x27;[aout]&#x27;])&#xA;        &#xA;        cmd.extend([&#x27;-y&#x27;, output_path])&#xA;&#xA;        print(f"Running ffmpeg command: {&#x27; &#x27;.join(cmd)}")&#xA;        result = subprocess.run(cmd, capture_output=True, text=True)&#xA;        &#xA;        if result.returncode != 0:&#xA;            print(f"FFmpeg error output: {result.stderr}")&#xA;            raise Exception(f"FFmpeg processing failed: {result.stderr}")&#xA;&#xA;        return send_file(&#xA;            output_path,&#xA;            mimetype=&#x27;video/mp4&#x27;,&#xA;            as_attachment=True,&#xA;            download_name=&#x27;final_video.mp4&#x27;&#xA;        )&#xA;&#xA;    except Exception as e:&#xA;        print(f"Error in video processing: {str(e)}")&#xA;        return {&#x27;error&#x27;: str(e)}, 500&#xA;    &#xA;    finally:&#xA;        if work_dir and os.path.exists(work_dir):&#xA;            try:&#xA;                print(f"Directory contents before cleanup: {os.listdir(work_dir)}")&#xA;                if not os.environ.get(&#x27;FLASK_DEBUG&#x27;):&#xA;                    shutil.rmtree(work_dir)&#xA;                else:&#xA;                    print(f"Keeping directory for debugging: {work_dir}")&#xA;            except Exception as e:&#xA;                print(f"Cleanup error: {str(e)}")&#xA;&#xA;                &#xA;if __name__ == &#x27;__main__&#x27;:&#xA;    app.run(debug=True, port=8000)&#xA;&#xA;

    &#xA;

    I'm also attaching what the final thing looks like on the frontend web vs in the downloaded video&#xA;and as u can see the downloaded video has all coords and positions messed up be it of the texts, images as well as videosdownloaded videos view&#xA;frontend web view

    &#xA;

    can somebody please help me figure this out :)

    &#xA;

  • FFmpeg - MJPEG decoding gives inconsistent values

    28 décembre 2016, par ahmadh

    I have a set of JPEG frames which I am muxing into an avi, which gives me a mjpeg video. This is the command I run on the console :

    ffmpeg -y -start_number 0 -i %06d.JPEG -codec copy vid.avi

    When I try to demux the video using ffmpeg C api, I get frames which are slightly different in values. Demuxing code looks something like this :

    AVFormatContext* fmt_ctx = NULL;
    AVCodecContext* cdc_ctx = NULL;
    AVCodec* vid_cdc = NULL;
    int ret;
    unsigned int height, width;

    ....
    // read_nframes is the number of frames to read
    output_arr = new unsigned char [height * width * 3 *
                                   sizeof(unsigned char) * read_nframes];

    avcodec_open2(cdc_ctx, vid_cdc, NULL);

    int num_bytes;
    uint8_t* buffer = NULL;
    const AVPixelFormat out_format = AV_PIX_FMT_RGB24;

    num_bytes = av_image_get_buffer_size(out_format, width, height, 1);
    buffer = (uint8_t*)av_malloc(num_bytes * sizeof(uint8_t));

    AVFrame* vid_frame = NULL;
    vid_frame = av_frame_alloc();
    AVFrame* conv_frame = NULL;
    conv_frame = av_frame_alloc();

    av_image_fill_arrays(conv_frame->data, conv_frame->linesize, buffer,
                        out_format, width, height, 1);

    struct SwsContext *sws_ctx = NULL;
    sws_ctx = sws_getContext(width, height, cdc_ctx->pix_fmt,
                            width, height, out_format,
                            SWS_BILINEAR, NULL,NULL,NULL);

    int frame_num = 0;
    AVPacket vid_pckt;
    while (av_read_frame(fmt_ctx, &amp;vid_pckt) >=0) {
       ret = avcodec_send_packet(cdc_ctx, &amp;vid_pckt);
       if (ret &lt; 0)
           break;

       ret = avcodec_receive_frame(cdc_ctx, vid_frame);
       if (ret &lt; 0 &amp;&amp; ret != AVERROR(EAGAIN) &amp;&amp; ret != AVERROR_EOF)
           break;
       if (ret >= 0) {
           // convert image from native format to planar GBR
           sws_scale(sws_ctx, vid_frame->data,
                     vid_frame->linesize, 0, vid_frame->height,
                     conv_frame->data, conv_frame->linesize);

           unsigned char* r_ptr = output_arr +
               (height * width * sizeof(unsigned char) * 3 * frame_num);
           unsigned char* g_ptr = r_ptr + (height * width * sizeof(unsigned char));
           unsigned char* b_ptr = g_ptr + (height * width * sizeof(unsigned char));
           unsigned int pxl_i = 0;

           for (unsigned int r = 0; r &lt; height; ++r) {
               uint8_t* avframe_r = conv_frame->data[0] + r*conv_frame->linesize[0];
               for (unsigned int c = 0; c &lt; width; ++c) {
                   r_ptr[pxl_i] = avframe_r[0];
                   g_ptr[pxl_i]   = avframe_r[1];
                   b_ptr[pxl_i]   = avframe_r[2];
                   avframe_r += 3;
                   ++pxl_i;
               }
           }

           ++frame_num;

           if (frame_num >= read_nframes)
               break;
       }
    }

    ...

    In my experience around two-thirds of the pixel values are different, each by +-1 (in a range of [0,255]). I am wondering is it due to some decoding scheme FFmpeg uses for reading JPEG frames ? I tried encoding and decoding png frames, and it works perfectly fine. I am sure this is something to do with the libav decoding process because the MD5 values are consistent between the images and the video :

    ffmpeg -i %06d.JPEG -f framemd5 -
    ffmpeg -i vid.avi -f framemd5 -

    In short my goal is to get the same pixel by pixel values for each JPEG frame as I would I have gotten if I was reading the JPEG images directly. Here is the stand-alone bitbucket code I used. It includes cmake files to build code, and a couple of jpeg frames with the converted avi file to test this problem. (give ’—filetype png’ to test the png decoding).