Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Why is using ffmpeg to convert MXF files failing ?
24 mars, par MarinaioI have an MXF video
I googled syntax to convert to mov and ran it in Mobaxterm on Win10.
"/drives/c/Program Files (x86)/ffmpeg/bin/ffmpeg.exe" -i Clip0001.MXF -c:v libx264 -c:a aac -ab 384k -sn -strict -2 output.mov
I view it in VideoLan and it looks great.
I load it into Magix Movie Studio 15 and audio is fine, but video is green!
ffmpeg output.mov....shows me:
Stream #0:0(eng): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 4530 kb/s, 29.97 fps, 29.97 tbr, 30k tbn, 59.94 tbc (default)
Even this does not work:
ffmpeg.exe -i Clip0001.MXF output.mov
Any suggestions on converting this?
Edit1:
Here is what it looks like in the editor:
Edit2: Try this and it works, but quality is terrible.
ffmpeg.exe" -i Clip0001.MXF -c:v mpeg4 -c:a aac -ab 384k -sn -strict -2 output.mov
-
Convert audio files to mp3 using ffmpeg [closed]
24 mars, par Hrishikesh -Rishi- ChoudhariI need to convert audio files to mp3 using ffmpeg.
When I write the command as
ffmpeg -i audio.ogg -acodec mp3 newfile.mp3
, I get the error:FFmpeg version 0.5.2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: libavutil 49.15. 0 / 49.15. 0 libavcodec 52.20. 1 / 52.20. 1 libavformat 52.31. 0 / 52.31. 0 libavdevice 52. 1. 0 / 52. 1. 0 built on Jun 24 2010 14:56:20, gcc: 4.4.1 Input #0, mp3, from 'ZHRE.mp3': Duration: 00:04:12.52, start: 0.000000, bitrate: 208 kb/s Stream #0.0: Audio: mp3, 44100 Hz, stereo, s16, 256 kb/s Output #0, mp3, to 'audio.mp3': Stream #0.0: Audio: 0x0000, 44100 Hz, stereo, s16, 64 kb/s Stream mapping: Stream #0.0 -> #0.0 Unsupported codec for output stream #0.0
I also ran this command:
ffmpeg -formats | grep mp3
and got this in response:
FFmpeg version 0.5.2, Copyright (c) 2000-2009 Fabrice Bellard, et al. configuration: libavutil 49.15. 0 / 49.15. 0 libavcodec 52.20. 1 / 52.20. 1 libavformat 52.31. 0 / 52.31. 0 libavdevice 52. 1. 0 / 52. 1. 0 built on Jun 24 2010 14:56:20, gcc: 4.4.1 DE mp3 MPEG audio layer 3 D A mp3 MP3 (MPEG audio layer 3) D A mp3adu ADU (Application Data Unit) MP3 (MPEG audio layer 3) D A mp3on4 MP3onMP4 text2movsub remove_extra noise mov2textsub mp3decomp mp3comp mjpegadump imxdump h264_mp4toannexb dump_extra
I guess that the mp3 codec isn't installed. Am I on the right track here?
-
FFmpeg.js in React/Vite : Worker.js 504 Error and Loading Stalls After load()
24 mars, par METHESWAR S RI'm trying to implement video compression in a React application using @ffmpeg/ffmpeg with Vite, but I'm encountering issues with loading the FFmpeg core files. The loading process stalls after calling load(), and I'm getting a 504 error for the worker.js file.
When initializing FFmpeg in my React component, the loading process hangs after calling ffmpeg.load(). In the network tab, I see a 504 Gateway Timeout error for worker.js?type=module&worker_file.
const loadFFmpeg = async () => { try { setIsLoading(true); const ffmpegInstance = new FFmpeg(); ffmpegInstance.on('log', ({ message }) => { console.log(message); }); ffmpegInstance.on('progress', ({ progress: prog }) => { setProgress(prog * 100); }); // Attempting to load FFmpeg await ffmpegInstance.load(); // Stalls here // Also tried with explicit URLs: // await ffmpegInstance.load({ // coreURL: 'https://unpkg.com/.../ffmpeg-core.js', // wasmURL: 'https://unpkg.com/.../ffmpeg-core.wasm', // workerURL: 'https://unpkg.com/.../ffmpeg-core.worker.js' // }); setFFmpeg(ffmpegInstance); setIsReady(true); } catch (err) { console.error('FFmpeg load error:', err); setError('Failed to initialize FFmpeg'); } finally { setIsLoading(false); } };
-
PHP-FFMPEG How can I display the progress ?
24 mars, par MondiFormathttps://github.com/PHP-FFMpeg/PHP-FFMpeg?tab=readme-ov-file#formats
The callback provided for the event can be any callable.
I'm just learning and I don't understand how to make a callback. Is it possible to give an example, please?
-
FFmpeg, low quality merge using overlay filter [closed]
24 mars, par He2AI am currently building a script, part of its functionality is to generate a cover art. I want to limit the scripts dependency to ffmpeg only so please don't suggest to use any other software to do the same.
For this, I am using ffmpeg to generate separate components for the coverart, code is given below:
# Draws transparent circle in correct background ffmpeg -y -f lavfi -i "color=c=0x20292FFF:s=4000x4000,format=rgba" -filter_complex "geq=r='32':g='41':b='47':a='255*(1-between(hypot(X-2000,Y-2000),0,1150))'" -frames:v 1 -update 1 background.png # Draws a circle gradient ffmpeg -y -f lavfi -i "gradients=s=4000x4000:c0=0x33517e:c1=0x645098:c2=0xa53f97:c3=0xdf1177:c4=0xff033e:c5=0x2f4858:n=5:y0=750:x0=750:y1=3250:x1=3250:t=linear,format=rgba" -filter_complex "geq=g='g(X,Y)':a='255*between(hypot(X-2000,Y-2000),0,1200)'" -frames:v 1 -update 1 gradcir.png # Draws the inner symbol ffmpeg -y -f lavfi -i "color=c=0x20292FFF:s=4000x4000,format=rgba" -vf "geq=a='255*max(lte((X-2000+(530/3)+25)+sqrt(3)*abs(Y-2000),530)*gte(X-2000+(530/3)+25,0),between(hypot(X-2000,Y-2000),570,630))':r='255*max(lte((X-2000+(530/3)+25)+sqrt(3)*abs(Y-2000),530)*gte(X-2000+(530/3)+25,0),between(hypot(X-2000,Y-2000),570,630))':g='255*max(lte((X-2000+(530/3)+25)+sqrt(3)*abs(Y-2000),530)*gte(X-2000+(530/3)+25,0),between(hypot(X-2000,Y-2000),570,630))':b='255*max(lte((X-2000+(530/3)+25)+sqrt(3)*abs(Y-2000),530)*gte(X-2000+(530/3)+25,0),between(hypot(X-2000,Y-2000),570,630))'" -frames:v 1 shape.png
Now to merge all three pngs, I am using the following command:
ffmpeg -y -i background.png -i gradcir.png -i shape.png -filter_complex "[0][1]overlay[tmp];[tmp][2]overlay" cover.png
All the code works but the problem is that the output is severely low quality with banding and improper merges in the borders of each image.
I believe png is lossless so there shouldn't be any issue with artifacts but still I experimented with different levels of png compression but to no avail. I even tried enforcing rgba format for all three images prior to merging but to no avail.
For now I alleviated the problem by generating all images in 4000x4000 resolution, applying a deband filter and then resizing it to 1000x1000.
ffmpeg -y -i background.png -i gradcir.png -i shape.png -filter_complex "[0][1]overlay[tmp1];[tmp1][2]overlay[tmp2];[tmp2]format=rgb24,scale=2000:2000:flags=spline,deband,scale=1000:1000:flags=lanczos" -frames:v 1 -update 1 cover.png
But the above method is expensive, which is problematic for low performance systems. Can anyone find out what seems to be the issue or suggest some better way to merge it?