Recherche avancée

Médias (1)

Mot : - Tags -/remix

Autres articles (63)

  • MediaSPIP Core : La Configuration

    9 novembre 2010, par

    MediaSPIP Core fournit par défaut trois pages différentes de configuration (ces pages utilisent le plugin de configuration CFG pour fonctionner) : une page spécifique à la configuration générale du squelettes ; une page spécifique à la configuration de la page d’accueil du site ; une page spécifique à la configuration des secteurs ;
    Il fournit également une page supplémentaire qui n’apparait que lorsque certains plugins sont activés permettant de contrôler l’affichage et les fonctionnalités spécifiques (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • Les autorisations surchargées par les plugins

    27 avril 2010, par

    Mediaspip core
    autoriser_auteur_modifier() afin que les visiteurs soient capables de modifier leurs informations sur la page d’auteurs

Sur d’autres sites (11306)

  • I want it to do the ffmpeg convert while the application continues to run

    2 janvier, par Mustafa Gemsiz

    Downloading with yd-dl.exe is successful, but it does not convert the downloaded video to mp4 with ffmpeg. When I stop compiling the project in visual studio, it converts the ffmpeg file to mp4.

    


    using System;&#xA;using System.Diagnostics;&#xA;using System.IO;&#xA;using System.Threading.Tasks;&#xA;using System.Windows.Forms;&#xA;&#xA;namespace YouTube_MP4_indir&#xA;{&#xA;    public partial class Form1 : Form&#xA;    {&#xA;        public Form1()&#xA;        {&#xA;            InitializeComponent();&#xA;            pictureBox2.Visible = false;&#xA;            pictureBox3.Visible = false;&#xA;        }&#xA;&#xA;        private async void btnDownload_Click(object sender, EventArgs e)&#xA;        {&#xA;            searchBox.Enabled = false;&#xA;            btnDownload.Enabled = false;&#xA;            pictureBox2.Visible = true;&#xA;            pictureBox3.Visible = false;&#xA;&#xA;            string url = searchBox.Text.Trim();&#xA;            if (string.IsNullOrEmpty(url))&#xA;            {&#xA;                DialogResult result = MessageBox.Show("L&#xFC;tfen ge&#xE7;erli bir YouTube URL&#x27;si giriniz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);&#xA;&#xA;                if (result == DialogResult.OK)&#xA;                {&#xA;                    searchBox.Text = "";&#xA;                    searchBox.Enabled = true;&#xA;                    btnDownload.Enabled = true;&#xA;                }&#xA;&#xA;                pictureBox2.Visible = false;&#xA;                pictureBox3.Visible = false;&#xA;                return;&#xA;            }&#xA;&#xA;            string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);&#xA;            string videosFolderPath = Path.Combine(desktopPath, "Videolar");&#xA;&#xA;            if (!Directory.Exists(videosFolderPath))&#xA;            {&#xA;                Directory.CreateDirectory(videosFolderPath);&#xA;            }&#xA;&#xA;            string videoTitle = await GetVideoTitle(url);&#xA;&#xA;            if (string.IsNullOrEmpty(videoTitle))&#xA;            {&#xA;                MessageBox.Show("Video başlığı alınamadı.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);&#xA;                pictureBox2.Visible = false;&#xA;                pictureBox3.Visible = false;&#xA;                return;&#xA;            }&#xA;&#xA;            string inputFilePath = Path.Combine(videosFolderPath, $"{videoTitle}.mp4");&#xA;            string outputFilePath = Path.Combine(videosFolderPath, $"{videoTitle}-d&#xF6;n&#xFC;şt&#xFC;r&#xFC;lm&#xFC;ş.mp4");&#xA;&#xA;            try&#xA;            {&#xA;                var ytDlpPath = Path.Combine(Application.StartupPath, "files", "yt-dlp.exe");&#xA;&#xA;                var startInfo = new ProcessStartInfo()&#xA;                {&#xA;                    FileName = ytDlpPath,&#xA;                    Arguments = $"-f bestvideo[height&lt;=1080]&#x2B;bestaudio/best --merge-output-format mp4 --output \"{inputFilePath}\" {url}",&#xA;                    UseShellExecute = false,&#xA;                    CreateNoWindow = true,&#xA;                    RedirectStandardOutput = true,&#xA;                    RedirectStandardError = true&#xA;                };&#xA;&#xA;                var process = Process.Start(startInfo);&#xA;                string output = await process.StandardOutput.ReadToEndAsync();&#xA;                string error = await process.StandardError.ReadToEndAsync();&#xA;&#xA;                await process.WaitForExitAsync();&#xA;&#xA;                if (process.ExitCode == 0)&#xA;                {&#xA;                    // Paralel olarak FFmpeg d&#xF6;n&#xFC;şt&#xFC;rme işlemini başlat&#xA;                    _ = Task.Run(() => ConvertToMp4(inputFilePath, outputFilePath));&#xA;&#xA;                    MessageBox.Show("İndirme tamamlandı. Video d&#xF6;n&#xFC;şt&#xFC;r&#xFC;l&#xFC;yor.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);&#xA;&#xA;                    searchBox.Text = "";&#xA;                    searchBox.Enabled = true;&#xA;                    btnDownload.Enabled = true;&#xA;&#xA;                    pictureBox2.Visible = false;&#xA;                    pictureBox3.Visible = true;&#xA;                }&#xA;                else&#xA;                {&#xA;                    MessageBox.Show("L&#xFC;tfen sadece video linki giriniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);&#xA;&#xA;                    pictureBox2.Visible = false;&#xA;                    pictureBox3.Visible = false;&#xA;                }&#xA;            }&#xA;            catch (Exception ex)&#xA;            {&#xA;                MessageBox.Show("Hata: " &#x2B; ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);&#xA;&#xA;                pictureBox2.Visible = false;&#xA;                pictureBox3.Visible = false;&#xA;            }&#xA;        }&#xA;&#xA;        private async Task<string> GetVideoTitle(string url)&#xA;        {&#xA;            try&#xA;            {&#xA;                var ytDlpPath = Path.Combine(Application.StartupPath, "files", "yt-dlp.exe");&#xA;&#xA;                var startInfo = new ProcessStartInfo()&#xA;                {&#xA;                    FileName = ytDlpPath,&#xA;                    Arguments = $"-e {url}",&#xA;                    UseShellExecute = false,&#xA;                    CreateNoWindow = true,&#xA;                    RedirectStandardOutput = true,&#xA;                    RedirectStandardError = true&#xA;                };&#xA;&#xA;                var process = Process.Start(startInfo);&#xA;                string output = await process.StandardOutput.ReadToEndAsync();&#xA;                await process.WaitForExitAsync();&#xA;&#xA;                return output.Trim();&#xA;            }&#xA;            catch (Exception ex)&#xA;            {&#xA;                MessageBox.Show("Hata: " &#x2B; ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);&#xA;                return null;&#xA;            }&#xA;        }&#xA;&#xA;        private async Task ConvertToMp4(string inputFilePath, string outputFilePath)&#xA;        {&#xA;            try&#xA;            {&#xA;                var ffmpegPath = Path.Combine(Application.StartupPath, "files", "ffmpeg.exe");&#xA;&#xA;                var startInfo = new ProcessStartInfo&#xA;                {&#xA;                    FileName = ffmpegPath,&#xA;                    Arguments = $"-i \"{inputFilePath}\" -c:v libx264 -preset ultrafast -crf 23 -s hd1080 \"{outputFilePath}\"",&#xA;                    UseShellExecute = false,&#xA;                    CreateNoWindow = true,&#xA;                    RedirectStandardOutput = true,&#xA;                    RedirectStandardError = true&#xA;                };&#xA;&#xA;                var process = Process.Start(startInfo);&#xA;                string output = await process.StandardOutput.ReadToEndAsync();&#xA;                string error = await process.StandardError.ReadToEndAsync();&#xA;&#xA;                await process.WaitForExitAsync();&#xA;&#xA;                if (process.ExitCode == 0)&#xA;                {&#xA;                    MessageBox.Show("D&#xF6;n&#xFC;şt&#xFC;rme işlemi başarılı.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);&#xA;&#xA;                    if (File.Exists(inputFilePath))&#xA;                    {&#xA;                        File.Delete(inputFilePath);&#xA;                    }&#xA;                }&#xA;                else&#xA;                {&#xA;                    MessageBox.Show("D&#xF6;n&#xFC;şt&#xFC;rme sırasında bir hata oluştu: " &#x2B; error, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);&#xA;                }&#xA;            }&#xA;            catch (Exception ex)&#xA;            {&#xA;                MessageBox.Show("Hata: " &#x2B; ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);&#xA;            }&#xA;        }&#xA;&#xA;        private Form2 form2;&#xA;&#xA;        private void button2_Click(object sender, EventArgs e)&#xA;        {&#xA;            if (form2 == null || form2.IsDisposed)&#xA;            {&#xA;                form2 = new Form2();&#xA;                form2.Show();&#xA;            }&#xA;            else&#xA;            {&#xA;                form2.BringToFront();&#xA;            }&#xA;        }&#xA;    }&#xA;}&#xA;</string>

    &#xA;

    Downloading with yd-dl.exe is successful. as soon as the video is downloaded I want to convert it to mp4 with ffmpeg but it won't convert without stopping the project.

    &#xA;

  • 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;

  • Use FFmpeg concat two video, is output video level mistake ?

    27 février, par 哇哈哈
    video1&#xA;{&#xA;    "index": 0,&#xA;    "codec_name": "hevc",&#xA;    "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",&#xA;    "profile": "Main",&#xA;    "codec_type": "video",&#xA;    "codec_tag_string": "hev1",&#xA;    "codec_tag": "0x31766568",&#xA;    "width": 1920,&#xA;    "height": 1080,&#xA;    "coded_width": 1920,&#xA;    "coded_height": 1080,&#xA;    "has_b_frames": 2,&#xA;    "sample_aspect_ratio": "1:1",&#xA;    "display_aspect_ratio": "16:9",&#xA;    "pix_fmt": "yuv420p",&#xA;    "level": 120,&#xA;    "color_range": "tv",&#xA;    "chroma_location": "left",&#xA;    "field_order": "progressive",&#xA;    "refs": 1,&#xA;    "view_ids_available": "",&#xA;    "view_pos_available": "",&#xA;    "id": "0x1",&#xA;    "r_frame_rate": "30/1",&#xA;    "avg_frame_rate": "30/1",&#xA;    "time_base": "1/15360",&#xA;    "start_pts": 0,&#xA;    "start_time": "0.000000",&#xA;    "duration_ts": 200192,&#xA;    "duration": "13.033333",&#xA;    "bit_rate": "10794613",&#xA;    "nb_frames": "391",&#xA;    "extradata_size": 2496,&#xA;    "disposition": {&#xA;        "default": 1,&#xA;        "dub": 0,&#xA;        "original": 0,&#xA;        "comment": 0,&#xA;        "lyrics": 0,&#xA;        "karaoke": 0,&#xA;        "forced": 0,&#xA;        "hearing_impaired": 0,&#xA;        "visual_impaired": 0,&#xA;        "clean_effects": 0,&#xA;        "attached_pic": 0,&#xA;        "timed_thumbnails": 0,&#xA;        "non_diegetic": 0,&#xA;        "captions": 0,&#xA;        "descriptions": 0,&#xA;        "metadata": 0,&#xA;        "dependent": 0,&#xA;        "still_image": 0,&#xA;        "multilayer": 0&#xA;    },&#xA;    "tags": {&#xA;        "language": "eng",&#xA;        "handler_name": "VideoHandler",&#xA;        "vendor_id": "[0][0][0][0]",&#xA;        "encoder": "Lavc61.33.100 libx265",&#xA;        "timecode": "00:00:00;00"&#xA;    }&#xA;}&#xA;&#xA;video2 &#xA;{&#xA;    "index": 0,&#xA;    "codec_name": "hevc",&#xA;    "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",&#xA;    "profile": "Main",&#xA;    "codec_type": "video",&#xA;    "codec_tag_string": "hev1",&#xA;    "codec_tag": "0x31766568",&#xA;    "width": 1920,&#xA;    "height": 1080,&#xA;    "coded_width": 1920,&#xA;    "coded_height": 1080,&#xA;    "has_b_frames": 2,&#xA;    "sample_aspect_ratio": "1:1",&#xA;    "display_aspect_ratio": "16:9",&#xA;    "pix_fmt": "yuv420p",&#xA;    "level": 120,&#xA;    "color_range": "tv",&#xA;    "chroma_location": "left",&#xA;    "field_order": "progressive",&#xA;    "refs": 1,&#xA;    "view_ids_available": "",&#xA;    "view_pos_available": "",&#xA;    "id": "0x1",&#xA;    "r_frame_rate": "25/1",&#xA;    "avg_frame_rate": "25/1",&#xA;    "time_base": "1/12800",&#xA;    "start_pts": 0,&#xA;    "start_time": "0.000000",&#xA;    "duration_ts": 1309696,&#xA;    "duration": "102.320000",&#xA;    "bit_rate": "1024122",&#xA;    "nb_frames": "2558",&#xA;    "extradata_size": 2496,&#xA;    "disposition": {&#xA;        "default": 1,&#xA;        "dub": 0,&#xA;        "original": 0,&#xA;        "comment": 0,&#xA;        "lyrics": 0,&#xA;        "karaoke": 0,&#xA;        "forced": 0,&#xA;        "hearing_impaired": 0,&#xA;        "visual_impaired": 0,&#xA;        "clean_effects": 0,&#xA;        "attached_pic": 0,&#xA;        "timed_thumbnails": 0,&#xA;        "non_diegetic": 0,&#xA;        "captions": 0,&#xA;        "descriptions": 0,&#xA;        "metadata": 0,&#xA;        "dependent": 0,&#xA;        "still_image": 0,&#xA;        "multilayer": 0&#xA;    },&#xA;    "tags": {&#xA;        "language": "und",&#xA;        "handler_name": "VideoHandler",&#xA;        "vendor_id": "[0][0][0][0]",&#xA;        "encoder": "Lavc61.33.100 libx265"&#xA;    }&#xA;}&#xA;&#xA;out:&#xA;{&#xA;    "index": 0,&#xA;    "codec_name": "hevc",&#xA;    "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",&#xA;    "profile": "Main",&#xA;    "codec_type": "video",&#xA;    "codec_tag_string": "hev1",&#xA;    "codec_tag": "0x31766568",&#xA;    "width": 1920,&#xA;    "height": 1080,&#xA;    "coded_width": 1920,&#xA;    "coded_height": 1080,&#xA;    "has_b_frames": 2,&#xA;    "sample_aspect_ratio": "1:1",&#xA;    "display_aspect_ratio": "16:9",&#xA;    "pix_fmt": "yuv420p",&#xA;    "level": 186,&#xA;    "color_range": "tv",&#xA;    "chroma_location": "left",&#xA;    "field_order": "progressive",&#xA;    "refs": 1,&#xA;    "view_ids_available": "",&#xA;    "view_pos_available": "",&#xA;    "id": "0x1",&#xA;    "r_frame_rate": "30/1",&#xA;    "avg_frame_rate": "147450/5767",&#xA;    "time_base": "1/1000000",&#xA;    "start_pts": 0,&#xA;    "start_time": "0.000000",&#xA;    "duration_ts": 115340000,&#xA;    "duration": "115.340000",&#xA;    "bit_rate": "1060604",&#xA;    "nb_frames": "2949",&#xA;    "extradata_size": 2500,&#xA;    "disposition": {&#xA;        "default": 1,&#xA;        "dub": 0,&#xA;        "original": 0,&#xA;        "comment": 0,&#xA;        "lyrics": 0,&#xA;        "karaoke": 0,&#xA;        "forced": 0,&#xA;        "hearing_impaired": 0,&#xA;        "visual_impaired": 0,&#xA;        "clean_effects": 0,&#xA;        "attached_pic": 0,&#xA;        "timed_thumbnails": 0,&#xA;        "non_diegetic": 0,&#xA;        "captions": 0,&#xA;        "descriptions": 0,&#xA;        "metadata": 0,&#xA;        "dependent": 0,&#xA;        "still_image": 0,&#xA;        "multilayer": 0&#xA;    },&#xA;    "tags": {&#xA;        "language": "und",&#xA;        "handler_name": "VideoHandler",&#xA;        "vendor_id": "[0][0][0][0]",&#xA;        "encoder": "Lavc61.33.100 libx265"&#xA;    }&#xA;}&#xA;

    &#xA;

    output video level is 6.2 ? i wiki level refer to fps resolusion or bitrate,but not suit this output video.&#xA;0。0 ! Could Someone HELP me ?

    &#xA;

    ffmpeg -i .\HEVC_1080p_30P_yellowtree.mp4 -i .\HEVC_1080p_24fps_happy.mp4 -filter_complex "[0:v][1:v]concat=n=2:v=1:a=0[outv]" -map "[outv]" -c:v libx265 concat_output.mp4

    &#xA;

    ffmpeg version N-118448-g43be8d0728-20250209 Copyright (c) 2000-2025 the FFmpeg developers&#xA;built with gcc 14.2.0 (crosstool-NG 1.26.0.120_4d36f27)&#xA;configuration : —prefix=/ffbuild/prefix —pkg-config-flags=—static —pkg-config=pkg-config —cross-prefix=x86_64-w64-mingw32- —arch=x86_64 —target-os=mingw32 —enable-gpl —enable-version3 —disable-debug —enable-shared —disable-static —disable-w32threads —enable-pthreads —enable-iconv —enable-zlib —enable-libfreetype —enable-libfribidi —enable-gmp —enable-libxml2 —enable-lzma —enable-fontconfig —enable-libharfbuzz —enable-libvorbis —enable-opencl —disable-libpulse —enable-libvmaf —disable-libxcb —disable-xlib —enable-amf —enable-libaom —enable-libaribb24 —enable-avisynth —enable-chromaprint —enable-libdav1d —enable-libdavs2 —enable-libdvdread —enable-libdvdnav —disable-libfdk-aac —enable-ffnvcodec —enable-cuda-llvm —enable-frei0r —enable-libgme —enable-libkvazaar —enable-libaribcaption —enable-libass —enable-libbluray —enable-libjxl —enable-libmp3lame —enable-libopus —enable-librist —enable-libssh —enable-libtheora —enable-libvpx —enable-libwebp —enable-libzmq —enable-lv2 —enable-libvpl —enable-openal —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenh264 —enable-libopenjpeg —enable-libopenmpt —enable-librav1e —enable-librubberband —enable-schannel —enable-sdl2 —enable-libsnappy —enable-libsoxr —enable-libsrt —enable-libsvtav1 —enable-libtwolame —enable-libuavs3d —disable-libdrm —enable-vaapi —enable-libvidstab —enable-vulkan —enable-libshaderc —enable-libplacebo —disable-libvvenc —enable-libx264 —enable-libx265 —enable-libxavs2 —enable-libxvid —enable-libzimg —enable-libzvbi —extra-cflags=-DLIBTWOLAME_STATIC —extra-cxxflags= —extra-libs=-lgomp —extra-ldflags=-pthread —extra-ldexeflags= —cc=x86_64-w64-mingw32-gcc —cxx=x86_64-w64-mingw32-g++ —ar=x86_64-w64-mingw32-gcc-ar —ranlib=x86_64-w64-mingw32-gcc-ranlib —nm=x86_64-w64-mingw32-gcc-nm —extra-version=20250209&#xA;libavutil 59. 56.100 / 59. 56.100&#xA;libavcodec 61. 33.100 / 61. 33.100&#xA;libavformat 61. 9.107 / 61. 9.107&#xA;libavdevice 61. 4.100 / 61. 4.100&#xA;libavfilter 10. 9.100 / 10. 9.100&#xA;libswscale 8. 13.100 / 8. 13.100&#xA;libswresample 5. 4.100 / 5. 4.100&#xA;libpostproc 58. 4.100 / 58. 4.100

    &#xA;