فيديو إلى MP3
أخرج الصوت من الفيديو واحتفظ به بصيغة MP3 أو WAV أو OGG. لا شيء يُرفع — التحويل يجري على جهازك.
متصفحك هو الذي يقرأ الملف ويعيد ترميزه. لا يُرسَل في أي طلب إلى أي مكان — فهذه الصفحة لا تملك خادمًا يُرفع إليه.
أسئلة
هل يُرفع الفيديو؟
لا. يفكّ المتصفح الملف ويرمّز الصوت محليًا، فلا يخرج شيء. وهذا هنا أهم منه في تحويلات أخرى: فالدافع لاستخراج صوت من فيديو غالبًا أن الفيديو شخصي — محاضرة أو مقابلة أو تسجيل لك — ولا شأن له بخادم أحد ليجيب سؤالًا يجيبه حاسوبك وحده.
أي صيغة أختار؟
MP3 إن كان الملف ذاهبًا إلى أي مكان: كل جهاز يشغّله، وعند 192 كيلوبت/ث يكون شفافًا للكلام وقريبًا من ذلك للموسيقى. وWAV إن كان الصوت ذاهبًا إلى برنامج مونتاج أو أداة تفريغ، لأنه غير مضغوط ولا يفقد شيئًا. وOGG (فوربيس) أصغر من MP3 عند الجودة نفسها لكنه أقل قبولًا خارج المتصفحات وأندرويد.
أي معدّل بت أحتاج؟
للكلام يكفي 96–128 كيلوبت/ث بوفرة، ويقلّص الملف إلى نصف الافتراضي. وللموسيقى 192 هي النقطة المعتادة، و320 أقصى ما يقدّمه MP3. وطلب أعلى مما سُجّل به المصدر لا يضيف شيئًا: تحويل بودكاست من 128 إلى 320 ينتج ملفًا أكبر بمرتين ونصف يبدو مطابقًا تمامًا.
لماذا ملف WAV كبير إلى هذا الحد؟
لأنه غير مضغوط — نحو 10 ميجابايت للدقيقة بالستيريو عند 44.1 كيلوهرتز، مهما كان محتواه. وهذا هو المقصود منه: لا يُطرح شيء. وإن كان الحجم مشكلة ولم يكن الصوت ذاهبًا إلى برنامج مونتاج، فإن MP3 يشغل جزءًا من عشرين ولن تسمع فرقًا.
هل يمكنني تحويل جزء من الفيديو فقط؟
ليس في هذه الصفحة — فهي تحوّل الملف كاملًا. اقتطع الفيديو أولًا بأداة القص وحوّل الناتج، أو حوّل كل شيء ثم اقتطع الصوت في البرنامج الذي ستأخذه إليه.
الأدوات الأخرى
أضف هذا إلى مشروعك
Pulling audio out of a video, locally — the same way this page does it, on the user's machine, with no server. Take the code, or hand the prompt to a coding agent.
// npm i mediabunny @mediabunny/mp3-encoder
import { Input, Output, Conversion, BlobSource, BufferTarget, Mp3OutputFormat, ALL_FORMATS } from 'mediabunny';
import { registerMp3Encoder } from '@mediabunny/mp3-encoder';
registerMp3Encoder(); // LAME compiled to WASM; only needed for MP3 output
export async function extractAudio(file, { bitrate = 192_000, mono = false } = {}) {
const input = new Input({ source: new BlobSource(file), formats: ALL_FORMATS });
const output = new Output({ format: new Mp3OutputFormat(), target: new BufferTarget() });
const conversion = await Conversion.init({
input,
output,
video: { discard: true }, // leave the picture behind
audio: { bitrate, ...(mono ? { numberOfChannels: 1 } : {}) },
});
if (!conversion.isValid) throw new Error('No audio track, or it cannot be decoded');
await conversion.execute();
return new Blob([output.target.buffer], { type: 'audio/mpeg' });
}
const mp3 = await extractAudio(file, { bitrate: 192_000 }); Add "extract the audio from a video" to my project. It must run entirely in the browser — the
files are personal (lectures, interviews, recordings) and must not be uploaded anywhere.
Requirements:
- Use "mediabunny" for decoding and "@mediabunny/mp3-encoder" for MP3 (LAME compiled to WASM).
Import the MP3 encoder lazily — only load it when the user actually picks MP3.
- Support MP3, WAV and OGG output. Set video: { discard: true } so only the audio is written.
- WAV has no bitrate to choose: hide that control when WAV is selected, because its size is
sampleRate x 2 bytes x channels and nothing else.
- Predict the output size before converting, and read the real channel count and sample rate off the
file to do it — assuming stereo doubles the estimate for a mono source. For Vorbis apply about 0.7
to the nominal bitrate, since it runs variable-rate and lands under.
- Tell the user when a requested bitrate exceeds what the source was recorded at: it makes the file
bigger without making it sound better.
- Fail clearly when the file has no audio track at all, before doing any work.
Reference implementation: https://life2film.com/tools/video-to-mp3/
The engine is documented for agents, and every tool page is available as
markdown by adding .md to its address.