| View previous topic :: View next topic |
| Author |
Message |
dlinuxor
Joined: 14 May 2008 Posts: 2
|
Posted: Wed May 14, 2008 5:36 pm Post subject: Pymedia: extract audio from video |
|
|
Hello.
I'm really new to pymedia, maybe this is a stupid question but here i go.
I want to know if i can extract audio from a video file (flv ,mpg or avi) and save it in mp3 format, if yes, how?. a quick example or a link, anything would be good.
Thanx in advance.
|
|
| Back to top |
|
 |
dhenrie Newbie
Joined: 16 Jul 2008 Posts: 5
|
Posted: Wed Jul 16, 2008 9:43 am Post subject: script for extracting audio |
|
|
I'm also new to pymedia.
I've 'reverse engineered' the vplayer example into an audio extractor as part of a audio sync test that I'm working on. I did this by finding the last line dealing with the audio before it was outputted to the speakers (which I think was on line 247), and traced back to the variables and functions used in getting that data in that statement.
I'll post a link to it (and more info on it) once I'm allowed to.
|
|
| Back to top |
|
 |
jbors Site Admin

Joined: 12 Nov 2004 Posts: 1675
|
Posted: Wed Jul 16, 2008 2:10 pm Post subject: |
|
|
Yes you will need to demux the stream first:
examples\demux_audio_video.py
Then for each audio frame you have to convert into your favorite format:
recode_audio.py
|
|
| Back to top |
|
 |
dhenrie Newbie
Joined: 16 Jul 2008 Posts: 5
|
Posted: Mon Jul 21, 2008 7:55 am Post subject: audio extractor script |
|
|
Here's the script I use to extract audio from video. There's just a few lines of code you have to change at the top (dealing with the location of the video and the video name).
This script saves the audio to a .wav file in the same folder that the video file is in. It also prints some parameters of the sound after running. I hope it works for you.
| Description: |
|
 Download |
| Filename: |
extract.zip |
| Filesize: |
1.17 KB |
| Downloaded: |
682 Time(s) |
|
|
| Back to top |
|
 |
dlinuxor
Joined: 14 May 2008 Posts: 2
|
Posted: Thu Aug 07, 2008 8:41 pm Post subject: |
|
|
Thank you very much dhenrie.
That was what i was looking for.
|
|
| Back to top |
|
 |
dasli
Joined: 28 Jul 2009 Posts: 1
|
Posted: Tue Jul 28, 2009 2:33 am Post subject: |
|
|
| Hello, I offer to use Video mp3 Extractor PRO at GeoVid. It extract audio from video popular formats to mp3
|
|
| Back to top |
|
 |
|