Recherche avancée

Médias (1)

Mot : - Tags -/sintel

Autres articles (80)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (6894)

  • avcodec/h263dec : Don't call ff_thread_finish_setup() unnecessarily

    24 février, par Andreas Rheinhardt
    avcodec/h263dec : Don't call ff_thread_finish_setup() unnecessarily
    

    All hwaccels for MPEG-4/H.263 are run serially even when frame-threading
    is in use. Therefore there is no gain in calling
    ff_thread_finish_setup() in this case right before outputting
    the frame.

    Removing this call also allows to revert commit
    39a5c0ac0651113750d01f3ee6bcf3819de3d7ee.

    Signed-off-by : Andreas Rheinhardt <andreas.rheinhardt@outlook.com>

    • [DH] libavcodec/h263dec.c
  • 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;

  • Revision d67b608c5d : Remove redundant vp9_init_plane_quantizers call When aq mode is on, the quantiz

    14 août 2014, par Jingning Han

    Changed Paths :
     Modify /vp9/encoder/vp9_encodeframe.c



    Remove redundant vp9_init_plane_quantizers call

    When aq mode is on, the quantizer will be reset later in the same
    function (line 571).

    Change-Id : I20635db31261d136d04d5deeb881ad3957078bf1