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''...")
 
(Play a Tuxbox stream)
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Flash Video (FLV) to wav or mp3 ==
 
== 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.
+
It can be done 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.
 
  <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 ==
Line 12: Line 13:
 
It might be useful to crop and/or scale the video before writing PNGs:
 
It might be useful to crop and/or scale the video before writing PNGs:
 
  <nowiki>mplayer -nosound -benchmark /path/to/video.avi -vf crop=100:10:80:80,scale=50:50 -vo png:z=0</nowiki>
 
  <nowiki>mplayer -nosound -benchmark /path/to/video.avi -vf crop=100:10:80:80,scale=50:50 -vo png:z=0</nowiki>
This takes a 80x80px area, starting from (x,y)=(100,10), scales it to 50x50px and writes a PNG file for each frame.
+
This takes a 80x80px area, starting from (x,y)=(100,10), scales it to 50x50px and writes a PNG file for each frame. The result is a directory full of PNGs - a PNG sequence.
 +
 
 +
Or using FFmpeg:
 +
<nowiki>ffmpeg -i video-file.avi -vcodec png %05d.png</nowiki>
 +
Super fast!
 +
 
 +
== Play PNG sequence ==
 +
Mplayer is able to play PNG sequences. All PNGs must have the same geometry. The framerate ist defined by the ''-fps'' option. The command must be executed in the directory of the PNG files.
 +
<nowiki>mplayer mf:// type=png -fps 25</nowiki>
 +
Add a scaling video filter for very small images. ''Software scaler 4'' is useful to observe each pixel without blurring.
 +
<nowiki>mplayer mf:// -mf type=png -vf scale=320:240 -fps 25 
 +
mplayer mf:// -mf type=png -vf scale=320:240 -sws 4 -fps 25</nowiki>
 +
 
 +
 
 +
== Deinterlacing Filter ==
 +
Here is a great overview with examples of mplayer´s deinterlacing filters: [http://guru.multimedia.cx/deinterlacing-filters/ link]
 +
 
 +
 
 +
== Play raw video data (RGB24 format)==
 +
Play real raw data - binary files with RGB values for each pixel, 3 bytes per pixel, no header. At least the videos width and height must be entered - for example:
 +
<nowiki>mplayer -demuxer rawvideo -rawvideo w=85:h=48:format=rgb24 test.raw</nowiki>
 +
 
 +
 
 +
== Play a Tuxbox stream ==
 +
<nowiki>mplayer http://dbox:31339/$(printf '%04x,' $(GET http://dbox/control/zapto?getpids) )
 +
 
 +
Fullscreen, de-interlaced and with cache:
 +
mplayer -cache 1024 -vf pp=lb -fs http://dbox:31339/$(printf '%04x,' $(GET http://dbox/control/zapto?getpids) )
 +
</nowiki>

Latest revision as of 19:32, 29 August 2013

Flash Video (FLV) to wav or mp3

It can be done 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. The result is a directory full of PNGs - a PNG sequence.

Or using FFmpeg:

ffmpeg -i video-file.avi -vcodec png %05d.png

Super fast!

Play PNG sequence

Mplayer is able to play PNG sequences. All PNGs must have the same geometry. The framerate ist defined by the -fps option. The command must be executed in the directory of the PNG files.

mplayer mf:// type=png -fps 25

Add a scaling video filter for very small images. Software scaler 4 is useful to observe each pixel without blurring.

mplayer mf:// -mf type=png -vf scale=320:240 -fps 25  
mplayer mf:// -mf type=png -vf scale=320:240 -sws 4 -fps 25


Deinterlacing Filter

Here is a great overview with examples of mplayer´s deinterlacing filters: link


Play raw video data (RGB24 format)

Play real raw data - binary files with RGB values for each pixel, 3 bytes per pixel, no header. At least the videos width and height must be entered - for example:

mplayer -demuxer rawvideo -rawvideo w=85:h=48:format=rgb24 test.raw


Play a Tuxbox stream

mplayer http://dbox:31339/$(printf '%04x,' $(GET http://dbox/control/zapto?getpids) )

Fullscreen, de-interlaced and with cache:
mplayer -cache 1024 -vf pp=lb -fs http://dbox:31339/$(printf '%04x,' $(GET http://dbox/control/zapto?getpids) )