Linux - DesktopThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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!
Distribution: Gentoo Hardened using OpenRC not Systemd
Posts: 1,495
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!
[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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.