Difference between revisions of "Mplayer"

From Tomelec
Jump to: navigation, search
(Created page with "== Flash Video (FLV) to wav or mp3 == It´s can be in two easy steps. First extract the audio track using mplayer, then encode the wav-file to an mp3 using lame. The ''-novideo''...")
 
Line 3: Line 3:
 
  <nowiki>mplayer -ao pcm:file=sound.wav -novideo flashvideo.flv
 
  <nowiki>mplayer -ao pcm:file=sound.wav -novideo flashvideo.flv
 
lame sound.wav sound.mp3</nowiki>
 
lame sound.wav sound.mp3</nowiki>
This can be used for example to download music from Youtube. Possibly there is a better way with mencoder?
+
This can be used to get playable mp3 files from downloaded Youtube videos. Possibly there is a better way with mencoder?
  
 
== Video to PNG files ==
 
== Video to PNG files ==

Revision as of 13:46, 17 September 2011

Flash Video (FLV) to wav or mp3

It´s can be in two easy steps. First extract the audio track using mplayer, then encode the wav-file to an mp3 using lame. The -novideo option makes this operation faster.

mplayer -ao pcm:file=sound.wav -novideo flashvideo.flv
lame sound.wav sound.mp3

This can be used to get playable mp3 files from downloaded Youtube videos. Possibly there is a better way with mencoder?

Video to PNG files

Writing a PNG file for each frame in the Video file. PNG files will be written to the current directory.

mplayer -nosound -benchmark -vo png:z=0 /path/to/video.avi

Output files are named 00000001.png, 00000002.png, 00000003.png, ...

It might be useful to crop and/or scale the video before writing PNGs:

mplayer -nosound -benchmark /path/to/video.avi -vf crop=100:10:80:80,scale=50:50 -vo png:z=0

This takes a 80x80px area, starting from (x,y)=(100,10), scales it to 50x50px and writes a PNG file for each frame.