| Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
|
12-06-2006, 07:27 PM
|
#1
|
|
Member
Registered: Sep 2006
Distribution: slackware
Posts: 132
Rep:
|
copy-mode extract of audio from youtube flv video
I would like to extract the audio from a youtube (.flv) file without re-encoding it. When I play the video with mplayer and watch the console (text) output I see that the audio is in mp3 form. Despite this, I cannot extract that to an mp3 file (attempts using mencoder and also with transcode). I can use transcode to extract the audio but only in a way converts it to PCM ... which is not what I want.
By the way, extracting just the video part (no sound) in copy-mode (not-re-encoding) is easy:
Code:
mencoder -of avi -nosound -ovc copy in.flv -o out_just_vid.avi
|
|
|
|
12-07-2006, 01:39 PM
|
#2
|
|
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,568
|
Try this:
'ffmpeg -i inputfile.flv -f mp3 -vn -acodec copy ouputfile.mp3'
That should do it for most files.
Apparently there are some microphone-recorded .flv files that use a proprietary codec that doesn't have any open source support. I don't know how common those are in the wild.
|
|
|
|
12-07-2006, 06:12 PM
|
#3
|
|
HCL Maintainer
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450
Rep:
|
The easiest and most elegant (IMO) way is:
Code:
mplayer -dumpaudio in.flv
This should leave a file called stream.dump in the original audio format (perhaps mp3), just extracted from the flv container.
|
|
|
|
12-07-2006, 08:23 PM
|
#4
|
|
Member
Registered: Sep 2006
Distribution: slackware
Posts: 132
Original Poster
Rep:
|
David The H. and osor, I tried both your methods and both worked! Not only that, the files produced by the two methods are identical. Most excellent! Thank you both! Yay! 
|
|
|
|
05-01-2008, 01:58 AM
|
#5
|
|
Senior Member
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,426
Rep:
|
Quote:
Originally Posted by moob8
David The H. and osor, I tried both your methods and both worked! Not only that, the files produced by the two methods are identical. Most excellent! Thank you both! Yay! 
|
How come neither worked for me
Code:
[root@localhost tmp]# ffmpeg -i video.flv -f mp3 -vn -acodec copy carsounds2.mp3
FFmpeg version SVN-r10703, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/usr --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic --enable-liba52 --enable-libfaac --enable-libfaad --enable-libgsm --enable-libmp3lame --enable-libogg --enable-libtheora --enable-libvorbis --enable-libxvid --enable-libx264 --enable-pp --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-opts --disable-strip
libavutil version: 49.5.0
libavcodec version: 51.45.0
libavformat version: 51.14.0
built on Oct 18 2007 03:18:27, gcc: 4.1.2 20070925 (Red Hat 4.1.2-31)
Seems stream 0 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 25.00 (25/1)
Input #0, flv, from 'video.flv':
Duration: 00:09:58.7, start: 0.000000, bitrate: 56 kb/s
Stream #0.0: Video: flv, yuv420p, 320x240, 25.00 fps(r)
Stream #0.1: Audio: mp3, 22050 Hz, mono, 56 kb/s
Output #0, mp3, to 'carsounds2.mp3':
Stream #0.0: Audio: libmp3lame, 22050 Hz, mono, 56 kb/s
Stream mapping:
Stream #0.1 -> #0.0
Press [q] to stop encoding
size= 4188kB time=598.8 bitrate= 57.3kbits/s
video:0kB audio:4188kB global headers:0kB muxing overhead 0.000746%
[root@localhost tmp]#
Code:
[chris@localhost tmp]$ mplayer -dumpaudio video.flv
MPlayer 1.0rc2-4.1.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model: 43, Stepping: 1)
CPUflags: MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing video.flv.
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
VIDEO: [FLV1] 320x240 0bpp 25.000 fps 0.0 kbps ( 0.0 kbyte/s)
Core dumped ;)
Exiting... (End of file)
[chris@localhost tmp]$
Dumping only the video has worked, but that's not what I want. Please help.
|
|
|
|
05-01-2008, 02:02 AM
|
#6
|
|
Senior Member
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,426
Rep:
|
I'm trying to get the audio only from here. I've already got the video.flv from that youtube site. Please help.
http://www.youtube.com/watch?v=Ejb8QOyjz-E&
I tried putting together some of my own commands just as a test. Here are the results.
Code:
[root@localhost tmp]# mencoder -novideo -ovc copy video.flv -o ultimatecarsounds2.mp3
MEncoder 1.0rc2-4.1.2 (C) 2000-2007 MPlayer Team
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ (Family: 15, Model: 43, Stepping: 1)
CPUflags: Type: 15 MMX: 1 MMX2: 1 3DNow: 1 3DNow2: 1 SSE: 1 SSE2: 1
Compiled with runtime CPU detection.
WARNING: OUTPUT FILE FORMAT IS _AVI_. See -of help.
success: format: 0 data: 0x0 - 0x16ed37e
libavformat file format detected.
[lavf] Video stream found, -vid 0
[lavf] Audio stream found, -aid 1
Video stream is mandatory!
Exiting...
[root@localhost tmp]#
That indicates the audio is there!
Last edited by fakie_flip; 05-01-2008 at 02:06 AM.
|
|
|
|
05-01-2008, 03:03 AM
|
#7
|
|
Senior Member
Registered: Feb 2005
Location: san antonio, texas
Distribution: Fedora 64 bit RAID0 + LUKS, CentOS (server), Backtrack, Gentoo Hardened
Posts: 1,426
Rep:
|
Nevermind, problem solved. I used Avidemux.
|
|
|
|
06-23-2008, 12:29 AM
|
#8
|
|
LQ Newbie
Registered: Jan 2006
Posts: 3
Rep:
|
extract audio from .flv files
To get the audio from a bunch of .flv files I use
for i in *.flv; do ffmpeg -i $i -f mp3 -vn -acodec copy $i.mp3 ;done
By the way; this linuxquestions format is a pain in the ass. Try to log in and then find the question you were trying to answer is nuts. The thread disappeared after I loged in.
bruce
|
|
|
|
06-23-2008, 02:45 AM
|
#9
|
|
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,568
|
Quote:
Originally Posted by bruce384
By the way; this linuxquestions format is a pain in the ass. Try to log in and then find the question you were trying to answer is nuts. The thread disappeared after I loged in.
|
Open up a new tab or window, log-in there, then go back to your original tab and hit refresh. Problem solved. 
|
|
|
|
04-13-2009, 01:35 AM
|
#10
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
Fakie_Flip: The video you posted is an mp4 file and not a flash video. It uses aac codec rather than mp3.
I was able to extract the audio easily with: ffmpeg -i Ultimate_Car_Sounds__Part_II.mp4 -vn -acodec copy ucs.m4a
I could have transcoded it to another audio format/codec.
Generally I will first play the source with "ffmpeg -identify <video_file>" and study the text output for what make up the video and audio streams. You can't go by the extension. It just indicates the container.
Last edited by jschiwal; 04-13-2009 at 03:46 AM.
|
|
|
|
07-17-2009, 01:30 AM
|
#11
|
|
LQ Newbie
Registered: May 2009
Posts: 1
Rep:
|
but i usually chose Audio Recorder
|
|
|
|
07-17-2009, 03:14 AM
|
#12
|
|
Bash Guru
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,568
|
Edit: deleted.
I should've noticed this was an older thread. I'd already replied to this one. 
Last edited by David the H.; 07-17-2009 at 03:50 AM.
|
|
|
|
01-11-2010, 07:23 AM
|
#13
|
|
LQ Newbie
Registered: Mar 2007
Location: india, kerala, trivandrum
Distribution: redhat, clarkconnect, ubuntu
Posts: 4
Rep:
|
extract audio from flv
use winff
|
|
|
1 members found this post helpful.
|
02-14-2010, 02:11 AM
|
#14
|
|
LQ Newbie
Registered: Feb 2008
Posts: 2
Rep:
|
Update: Solution
I know this is an old thread, but I found a solution over at UbuntuForums and thought I would post it here, too:
http://ubuntuforums.org/showpost.php...1&postcount=14
cheers,
ethan
|
|
|
1 members found this post helpful.
|
08-18-2011, 05:23 PM
|
#15
|
|
LQ Newbie
Registered: Dec 2006
Posts: 3
Rep:
|
dump and convert audio from flv to wav using mplayer
This way seems to work well (and one can see fast video meanwile ;-) ):
mplayer -ao pcm input.flv -ao pcm:file="output.wav"
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:19 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|