
Recherche avancée
Autres articles (111)
-
Submit bugs and patches
13 avril 2011Unfortunately a software is never perfect.
If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information : the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
You may also (...) -
Publier sur MédiaSpip
13 juin 2013Puis-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 -
Script d’installation automatique de MediaSPIP
25 avril 2011, parAfin de palier aux difficultés d’installation dues principalement aux dépendances logicielles coté serveur, un script d’installation "tout en un" en bash a été créé afin de faciliter cette étape sur un serveur doté d’une distribution Linux compatible.
Vous devez bénéficier d’un accès SSH à votre serveur et d’un compte "root" afin de l’utiliser, ce qui permettra d’installer les dépendances. Contactez votre hébergeur si vous ne disposez pas de cela.
La documentation de l’utilisation du script d’installation (...)
Sur d’autres sites (11982)
-
Use FFmpeg concat two video, is output video level mistake ?
27 février, par 哇哈哈video1
{
 "index": 0,
 "codec_name": "hevc",
 "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
 "profile": "Main",
 "codec_type": "video",
 "codec_tag_string": "hev1",
 "codec_tag": "0x31766568",
 "width": 1920,
 "height": 1080,
 "coded_width": 1920,
 "coded_height": 1080,
 "has_b_frames": 2,
 "sample_aspect_ratio": "1:1",
 "display_aspect_ratio": "16:9",
 "pix_fmt": "yuv420p",
 "level": 120,
 "color_range": "tv",
 "chroma_location": "left",
 "field_order": "progressive",
 "refs": 1,
 "view_ids_available": "",
 "view_pos_available": "",
 "id": "0x1",
 "r_frame_rate": "30/1",
 "avg_frame_rate": "30/1",
 "time_base": "1/15360",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 200192,
 "duration": "13.033333",
 "bit_rate": "10794613",
 "nb_frames": "391",
 "extradata_size": 2496,
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "language": "eng",
 "handler_name": "VideoHandler",
 "vendor_id": "[0][0][0][0]",
 "encoder": "Lavc61.33.100 libx265",
 "timecode": "00:00:00;00"
 }
}

video2 
{
 "index": 0,
 "codec_name": "hevc",
 "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
 "profile": "Main",
 "codec_type": "video",
 "codec_tag_string": "hev1",
 "codec_tag": "0x31766568",
 "width": 1920,
 "height": 1080,
 "coded_width": 1920,
 "coded_height": 1080,
 "has_b_frames": 2,
 "sample_aspect_ratio": "1:1",
 "display_aspect_ratio": "16:9",
 "pix_fmt": "yuv420p",
 "level": 120,
 "color_range": "tv",
 "chroma_location": "left",
 "field_order": "progressive",
 "refs": 1,
 "view_ids_available": "",
 "view_pos_available": "",
 "id": "0x1",
 "r_frame_rate": "25/1",
 "avg_frame_rate": "25/1",
 "time_base": "1/12800",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 1309696,
 "duration": "102.320000",
 "bit_rate": "1024122",
 "nb_frames": "2558",
 "extradata_size": 2496,
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "language": "und",
 "handler_name": "VideoHandler",
 "vendor_id": "[0][0][0][0]",
 "encoder": "Lavc61.33.100 libx265"
 }
}

out:
{
 "index": 0,
 "codec_name": "hevc",
 "codec_long_name": "H.265 / HEVC (High Efficiency Video Coding)",
 "profile": "Main",
 "codec_type": "video",
 "codec_tag_string": "hev1",
 "codec_tag": "0x31766568",
 "width": 1920,
 "height": 1080,
 "coded_width": 1920,
 "coded_height": 1080,
 "has_b_frames": 2,
 "sample_aspect_ratio": "1:1",
 "display_aspect_ratio": "16:9",
 "pix_fmt": "yuv420p",
 "level": 186,
 "color_range": "tv",
 "chroma_location": "left",
 "field_order": "progressive",
 "refs": 1,
 "view_ids_available": "",
 "view_pos_available": "",
 "id": "0x1",
 "r_frame_rate": "30/1",
 "avg_frame_rate": "147450/5767",
 "time_base": "1/1000000",
 "start_pts": 0,
 "start_time": "0.000000",
 "duration_ts": 115340000,
 "duration": "115.340000",
 "bit_rate": "1060604",
 "nb_frames": "2949",
 "extradata_size": 2500,
 "disposition": {
 "default": 1,
 "dub": 0,
 "original": 0,
 "comment": 0,
 "lyrics": 0,
 "karaoke": 0,
 "forced": 0,
 "hearing_impaired": 0,
 "visual_impaired": 0,
 "clean_effects": 0,
 "attached_pic": 0,
 "timed_thumbnails": 0,
 "non_diegetic": 0,
 "captions": 0,
 "descriptions": 0,
 "metadata": 0,
 "dependent": 0,
 "still_image": 0,
 "multilayer": 0
 },
 "tags": {
 "language": "und",
 "handler_name": "VideoHandler",
 "vendor_id": "[0][0][0][0]",
 "encoder": "Lavc61.33.100 libx265"
 }
}



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


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


ffmpeg version N-118448-g43be8d0728-20250209 Copyright (c) 2000-2025 the FFmpeg developers
built with gcc 14.2.0 (crosstool-NG 1.26.0.120_4d36f27)
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
libavutil 59. 56.100 / 59. 56.100
libavcodec 61. 33.100 / 61. 33.100
libavformat 61. 9.107 / 61. 9.107
libavdevice 61. 4.100 / 61. 4.100
libavfilter 10. 9.100 / 10. 9.100
libswscale 8. 13.100 / 8. 13.100
libswresample 5. 4.100 / 5. 4.100
libpostproc 58. 4.100 / 58. 4.100


-
FFmpeg overlay positioning issue : Converting frontend center coordinates to FFmpeg top-left coordinates
25 janvier, par tarunI'm building a web-based video editor where users can :


Add multiple videos
Add images
Add text overlays with background color


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


const exportAllVideos = async () => {
 try {
 const formData = new FormData();
 
 
 const normalizedVideos = videos.map(video => ({
 ...video,
 startTime: parseFloat(video.startTime),
 endTime: parseFloat(video.endTime),
 duration: parseFloat(video.duration)
 })).sort((a, b) => a.startTime - b.startTime);

 
 for (const video of normalizedVideos) {
 const response = await fetch(video.src);
 const blobData = await response.blob();
 const file = new File([blobData], `${video.id}.mp4`, { type: "video/mp4" });
 formData.append("videos", file);
 }

 
 const normalizedImages = images.map(image => ({
 ...image,
 startTime: parseFloat(image.startTime),
 endTime: parseFloat(image.endTime),
 x: parseInt(image.x),
 y: parseInt(image.y),
 width: parseInt(image.width),
 height: parseInt(image.height),
 opacity: parseInt(image.opacity)
 }));

 
 for (const image of normalizedImages) {
 const response = await fetch(image.src);
 const blobData = await response.blob();
 const file = new File([blobData], `${image.id}.png`, { type: "image/png" });
 formData.append("images", file);
 }

 
 const normalizedTexts = texts.map(text => ({
 ...text,
 startTime: parseFloat(text.startTime),
 endTime: parseFloat(text.endTime),
 x: parseInt(text.x),
 y: parseInt(text.y),
 fontSize: parseInt(text.fontSize),
 opacity: parseInt(text.opacity)
 }));

 
 formData.append("metadata", JSON.stringify({
 videos: normalizedVideos,
 images: normalizedImages,
 texts: normalizedTexts
 }));

 const response = await fetch("my_flask_endpoint", {
 method: "POST",
 body: formData
 });

 if (!response.ok) {
 
 console.log('wtf', response);
 
 }

 const finalVideo = await response.blob();
 const url = URL.createObjectURL(finalVideo);
 const a = document.createElement("a");
 a.href = url;
 a.download = "final_video.mp4";
 a.click();
 URL.revokeObjectURL(url);

 } catch (e) {
 console.log(e, "err");
 }
 };



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 -


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

 const newImage = {
 id: uuidv4(),
 src: URL.createObjectURL(imageData),
 x: containerWidth.width / 2,
 y: containerWidth.height / 2,
 width: 200,
 height: 200,
 borderRadius: 0,
 startTime: 0,
 endTime: 20,
 duration: 20,
 opacity: 100,
 };




BACKEND CODE -


import os
import shutil
import subprocess
from flask import Flask, request, send_file
import ffmpeg
import json
from werkzeug.utils import secure_filename
import uuid
from flask_cors import CORS


app = Flask(__name__)
CORS(app, resources={r"/*": {"origins": "*"}})



UPLOAD_FOLDER = 'temp_uploads'
if not os.path.exists(UPLOAD_FOLDER):
 os.makedirs(UPLOAD_FOLDER)


@app.route('/')
def home():
 return 'Hello World'


OUTPUT_WIDTH = 1920
OUTPUT_HEIGHT = 1080



@app.route('/process', methods=['POST'])
def process_video():
 work_dir = None
 try:
 work_dir = os.path.abspath(os.path.join(UPLOAD_FOLDER, str(uuid.uuid4())))
 os.makedirs(work_dir)
 print(f"Created working directory: {work_dir}")

 metadata = json.loads(request.form['metadata'])
 print("Received metadata:", json.dumps(metadata, indent=2))
 
 video_paths = []
 videos = request.files.getlist('videos')
 for idx, video in enumerate(videos):
 filename = f"video_{idx}.mp4"
 filepath = os.path.join(work_dir, filename)
 video.save(filepath)
 if os.path.exists(filepath) and os.path.getsize(filepath) > 0:
 video_paths.append(filepath)
 print(f"Saved video to: {filepath} Size: {os.path.getsize(filepath)}")
 else:
 raise Exception(f"Failed to save video {idx}")

 image_paths = []
 images = request.files.getlist('images')
 for idx, image in enumerate(images):
 filename = f"image_{idx}.png"
 filepath = os.path.join(work_dir, filename)
 image.save(filepath)
 if os.path.exists(filepath):
 image_paths.append(filepath)
 print(f"Saved image to: {filepath}")

 output_path = os.path.join(work_dir, 'output.mp4')

 filter_parts = []

 base_duration = metadata["videos"][0]["duration"] if metadata["videos"] else 10
 filter_parts.append(f'color=c=black:s={OUTPUT_WIDTH}x{OUTPUT_HEIGHT}:d={base_duration}[canvas];')

 for idx, (path, meta) in enumerate(zip(video_paths, metadata['videos'])):
 x_pos = int(meta.get("x", 0) - (meta.get("width", 0) / 2))
 y_pos = int(meta.get("y", 0) - (meta.get("height", 0) / 2))
 
 filter_parts.extend([
 f'[{idx}:v]setpts=PTS-STARTPTS,scale={meta.get("width", -1)}:{meta.get("height", -1)}[v{idx}];',
 f'[{idx}:a]asetpts=PTS-STARTPTS[a{idx}];'
 ])

 if idx == 0:
 filter_parts.append(
 f'[canvas][v{idx}]overlay=x={x_pos}:y={y_pos}:eval=init[temp{idx}];'
 )
 else:
 filter_parts.append(
 f'[temp{idx-1}][v{idx}]overlay=x={x_pos}:y={y_pos}:'
 f'enable=\'between(t,{meta["startTime"]},{meta["endTime"]})\':eval=init'
 f'[temp{idx}];'
 )

 last_video_temp = f'temp{len(video_paths)-1}'

 if video_paths:
 audio_mix_parts = []
 for idx in range(len(video_paths)):
 audio_mix_parts.append(f'[a{idx}]')
 filter_parts.append(f'{"".join(audio_mix_parts)}amix=inputs={len(video_paths)}[aout];')

 
 if image_paths:
 for idx, (img_path, img_meta) in enumerate(zip(image_paths, metadata['images'])):
 input_idx = len(video_paths) + idx
 
 
 x_pos = int(img_meta["x"] - (img_meta["width"] / 2))
 y_pos = int(img_meta["y"] - (img_meta["height"] / 2))
 
 filter_parts.extend([
 f'[{input_idx}:v]scale={img_meta["width"]}:{img_meta["height"]}[img{idx}];',
 f'[{last_video_temp}][img{idx}]overlay=x={x_pos}:y={y_pos}:'
 f'enable=\'between(t,{img_meta["startTime"]},{img_meta["endTime"]})\':'
 f'alpha={img_meta["opacity"]/100}[imgout{idx}];'
 ])
 last_video_temp = f'imgout{idx}'

 if metadata.get('texts'):
 for idx, text in enumerate(metadata['texts']):
 next_output = f'text{idx}' if idx < len(metadata['texts']) - 1 else 'vout'
 
 escaped_text = text["description"].replace("'", "\\'")
 
 x_pos = int(text["x"] - (text["width"] / 2))
 y_pos = int(text["y"] - (text["height"] / 2))
 
 text_filter = (
 f'[{last_video_temp}]drawtext=text=\'{escaped_text}\':'
 f'x={x_pos}:y={y_pos}:'
 f'fontsize={text["fontSize"]}:'
 f'fontcolor={text["color"]}'
 )
 
 if text.get('backgroundColor'):
 text_filter += f':box=1:boxcolor={text["backgroundColor"]}:boxborderw=5'
 
 if text.get('fontWeight') == 'bold':
 text_filter += ':font=Arial-Bold'
 
 text_filter += (
 f':enable=\'between(t,{text["startTime"]},{text["endTime"]})\''
 f'[{next_output}];'
 )
 
 filter_parts.append(text_filter)
 last_video_temp = next_output
 else:
 filter_parts.append(f'[{last_video_temp}]null[vout];')

 
 filter_complex = ''.join(filter_parts)

 
 cmd = [
 'ffmpeg',
 *sum([['-i', path] for path in video_paths], []),
 *sum([['-i', path] for path in image_paths], []),
 '-filter_complex', filter_complex,
 '-map', '[vout]'
 ]
 
 
 if video_paths:
 cmd.extend(['-map', '[aout]'])
 
 cmd.extend(['-y', output_path])

 print(f"Running ffmpeg command: {' '.join(cmd)}")
 result = subprocess.run(cmd, capture_output=True, text=True)
 
 if result.returncode != 0:
 print(f"FFmpeg error output: {result.stderr}")
 raise Exception(f"FFmpeg processing failed: {result.stderr}")

 return send_file(
 output_path,
 mimetype='video/mp4',
 as_attachment=True,
 download_name='final_video.mp4'
 )

 except Exception as e:
 print(f"Error in video processing: {str(e)}")
 return {'error': str(e)}, 500
 
 finally:
 if work_dir and os.path.exists(work_dir):
 try:
 print(f"Directory contents before cleanup: {os.listdir(work_dir)}")
 if not os.environ.get('FLASK_DEBUG'):
 shutil.rmtree(work_dir)
 else:
 print(f"Keeping directory for debugging: {work_dir}")
 except Exception as e:
 print(f"Cleanup error: {str(e)}")

 
if __name__ == '__main__':
 app.run(debug=True, port=8000)




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




can somebody please help me figure this out :)


-
I want it to do the ffmpeg convert while the application continues to run
2 janvier, par Mustafa GemsizDownloading 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;
using System.Diagnostics;
using System.IO;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace YouTube_MP4_indir
{
 public partial class Form1 : Form
 {
 public Form1()
 {
 InitializeComponent();
 pictureBox2.Visible = false;
 pictureBox3.Visible = false;
 }

 private async void btnDownload_Click(object sender, EventArgs e)
 {
 searchBox.Enabled = false;
 btnDownload.Enabled = false;
 pictureBox2.Visible = true;
 pictureBox3.Visible = false;

 string url = searchBox.Text.Trim();
 if (string.IsNullOrEmpty(url))
 {
 DialogResult result = MessageBox.Show("Lütfen geçerli bir YouTube URL'si giriniz.", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);

 if (result == DialogResult.OK)
 {
 searchBox.Text = "";
 searchBox.Enabled = true;
 btnDownload.Enabled = true;
 }

 pictureBox2.Visible = false;
 pictureBox3.Visible = false;
 return;
 }

 string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
 string videosFolderPath = Path.Combine(desktopPath, "Videolar");

 if (!Directory.Exists(videosFolderPath))
 {
 Directory.CreateDirectory(videosFolderPath);
 }

 string videoTitle = await GetVideoTitle(url);

 if (string.IsNullOrEmpty(videoTitle))
 {
 MessageBox.Show("Video başlığı alınamadı.", "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
 pictureBox2.Visible = false;
 pictureBox3.Visible = false;
 return;
 }

 string inputFilePath = Path.Combine(videosFolderPath, $"{videoTitle}.mp4");
 string outputFilePath = Path.Combine(videosFolderPath, $"{videoTitle}-dönüştürülmüş.mp4");

 try
 {
 var ytDlpPath = Path.Combine(Application.StartupPath, "files", "yt-dlp.exe");

 var startInfo = new ProcessStartInfo()
 {
 FileName = ytDlpPath,
 Arguments = $"-f bestvideo[height<=1080]+bestaudio/best --merge-output-format mp4 --output \"{inputFilePath}\" {url}",
 UseShellExecute = false,
 CreateNoWindow = true,
 RedirectStandardOutput = true,
 RedirectStandardError = true
 };

 var process = Process.Start(startInfo);
 string output = await process.StandardOutput.ReadToEndAsync();
 string error = await process.StandardError.ReadToEndAsync();

 await process.WaitForExitAsync();

 if (process.ExitCode == 0)
 {
 // Paralel olarak FFmpeg dönüştürme işlemini başlat
 _ = Task.Run(() => ConvertToMp4(inputFilePath, outputFilePath));

 MessageBox.Show("İndirme tamamlandı. Video dönüştürülüyor.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

 searchBox.Text = "";
 searchBox.Enabled = true;
 btnDownload.Enabled = true;

 pictureBox2.Visible = false;
 pictureBox3.Visible = true;
 }
 else
 {
 MessageBox.Show("Lütfen sadece video linki giriniz", "Uyarı", MessageBoxButtons.OK, MessageBoxIcon.Warning);

 pictureBox2.Visible = false;
 pictureBox3.Visible = false;
 }
 }
 catch (Exception ex)
 {
 MessageBox.Show("Hata: " + ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);

 pictureBox2.Visible = false;
 pictureBox3.Visible = false;
 }
 }

 private async Task<string> GetVideoTitle(string url)
 {
 try
 {
 var ytDlpPath = Path.Combine(Application.StartupPath, "files", "yt-dlp.exe");

 var startInfo = new ProcessStartInfo()
 {
 FileName = ytDlpPath,
 Arguments = $"-e {url}",
 UseShellExecute = false,
 CreateNoWindow = true,
 RedirectStandardOutput = true,
 RedirectStandardError = true
 };

 var process = Process.Start(startInfo);
 string output = await process.StandardOutput.ReadToEndAsync();
 await process.WaitForExitAsync();

 return output.Trim();
 }
 catch (Exception ex)
 {
 MessageBox.Show("Hata: " + ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
 return null;
 }
 }

 private async Task ConvertToMp4(string inputFilePath, string outputFilePath)
 {
 try
 {
 var ffmpegPath = Path.Combine(Application.StartupPath, "files", "ffmpeg.exe");

 var startInfo = new ProcessStartInfo
 {
 FileName = ffmpegPath,
 Arguments = $"-i \"{inputFilePath}\" -c:v libx264 -preset ultrafast -crf 23 -s hd1080 \"{outputFilePath}\"",
 UseShellExecute = false,
 CreateNoWindow = true,
 RedirectStandardOutput = true,
 RedirectStandardError = true
 };

 var process = Process.Start(startInfo);
 string output = await process.StandardOutput.ReadToEndAsync();
 string error = await process.StandardError.ReadToEndAsync();

 await process.WaitForExitAsync();

 if (process.ExitCode == 0)
 {
 MessageBox.Show("Dönüştürme işlemi başarılı.", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information);

 if (File.Exists(inputFilePath))
 {
 File.Delete(inputFilePath);
 }
 }
 else
 {
 MessageBox.Show("Dönüştürme sırasında bir hata oluştu: " + error, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
 }
 catch (Exception ex)
 {
 MessageBox.Show("Hata: " + ex.Message, "Hata", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
 }

 private Form2 form2;

 private void button2_Click(object sender, EventArgs e)
 {
 if (form2 == null || form2.IsDisposed)
 {
 form2 = new Form2();
 form2.Show();
 }
 else
 {
 form2.BringToFront();
 }
 }
 }
}
</string>


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.