InDashPC.org Forum Index InDashPC.org
In Dash Car PC forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Pymedia: extract audio from video

 
Post new topic   Reply to topic    InDashPC.org Forum Index -> Software
View previous topic :: View next topic  
Author Message
dlinuxor



Joined: 14 May 2008
Posts: 2

PostPosted: Wed May 14, 2008 5:36 pm    Post subject: Pymedia: extract audio from video Reply with quote

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
View user's profile Send private message
dhenrie
Newbie


Joined: 16 Jul 2008
Posts: 5

PostPosted: Wed Jul 16, 2008 9:43 am    Post subject: script for extracting audio Reply with quote

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
View user's profile Send private message
jbors
Site Admin


Joined: 12 Nov 2004
Posts: 1675

PostPosted: Wed Jul 16, 2008 2:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
dhenrie
Newbie


Joined: 16 Jul 2008
Posts: 5

PostPosted: Mon Jul 21, 2008 7:55 am    Post subject: audio extractor script Reply with quote

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.



extract.zip
 Description:
contains extract.py

Download
 Filename:  extract.zip
 Filesize:  1.17 KB
 Downloaded:  813 Time(s)

Back to top
View user's profile Send private message
dlinuxor



Joined: 14 May 2008
Posts: 2

PostPosted: Thu Aug 07, 2008 8:41 pm    Post subject: Reply with quote

Thank you very much dhenrie.

That was what i was looking for.
Back to top
View user's profile Send private message
dasli



Joined: 28 Jul 2009
Posts: 1

PostPosted: Tue Jul 28, 2009 2:33 am    Post subject: Reply with quote

Hello, I offer to use Video mp3 Extractor PRO at GeoVid. It extract audio from video popular formats to mp3
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    InDashPC.org Forum Index -> Software All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group