Доброго времени суток!
После simple filmix.net viewer и RTVomline как логическое продолжение возникла мысль написать класс-обертку для mplayer под MSE. Естественно, кроссплатформенную.
страница пректа
код и сборки под windows \ linux там же
Модератор: Модераторы
-tv <option1:option2:...>
This option enables the TV grabbing feature of MPlayer.
NOTE:
MPlayer doesn't accept colons so type dots instead in the device ID (e.g. hw.0,0 instead of hw:0,0).
Be advised that although you can select any samplerate when using ALSA, the LAME audio codec is able to encode only the 'standard' samplerates. You'll get an .avi file with no sound when you choose an odd samplerate and use this codec.
Available options are:
on
use TV input
noaudio
no sound
driver=<value>
available: dummy, v4l, bsdbt848
device=<value>
Specify other device than the default /dev/:video0.
input=<value>
Specify other input than the default 0 (Television) (see output for a list)
freq=<value>
Specify the frequency to set the tuner to (e.g. 511.250). Not compatible with channels parameter.
outfmt=<value>
output format of the tuner (yv12, rgb32, rgb24, rgb16, rgb15, uyvy, yuy2, i420)
width=<value>
width of the output window
height=<value>
height of the output window
fps=<value>
framerate at which to capture video (frames per second)
buffersize=<value>
maximum size of the capture buffer in megabytes (default: dynamical)
norm=<value>
available: PAL, SECAM, NTSC
channel=<value>
Set tuner to <value> channel.
chanlist=<value>
available: europe-east, europe-west, us-bcast, us-cable, etc
channels=<channel>-<name>,<channel>-<name>,...
Set names for channels. Use _ for spaces in names (or play with quoting . The channel names will then be written using OSD, and the commands tv_step_channel, tv_set_channel and tv_last_channel will then be usable using a remote (see lirc). Not compatible with frequency parameter. Warning: The channel number will then be the position in the 'channels' list, beginning with 1. Example: use tv://1, tv://2, tv_set_channel 1, tv_set_channel 2, etc.
audiorate=<value>
set audio capture bitrate
forceaudio
capture audio even if there are no audio sources reported by v4l
alsa
capture from ALSA
amode=<0-3>
choose an audio mode:
0: mono
1: stereo
2: language 1
3:
language 2
forcechan=<1-2>
By default, the count of recorded audio channels is determined automatically by querying the audio mode from the tv card. This option allows to force stereo/:mono recording regardless of the amode option and the values returned by v4l. This can be used for troubleshooting when the tv card is unable to report the current audio mode.
adevice=<value>
set an audio device
/dev/:... for OSS
hardware ID for ALSA
audioid=<value>
choose an audio output of the capture card, if it has more of them
[volume|bass|treble|balance]=<0-65535>
These options set parameters of the mixer on the video capture card. They will have no effect, if your card doesn't have one.
immediatemode=<bool>
A value of 0 means capture and buffer audio and video together (default for mencoder). A value of 1 (default for mplayer) means to do video capture only and let the audio go through a loopback cable from the TV card to the soundcard.
Slave Mode Protocol
If the -slave option is given, playback is controlled by a line-based protocol. Each line must contain one command otherwise one of the following tokens:
Commands
seek <value> [type=<0/:1/:2>]
Seek to some place in the movie. Type 0 is a relative seek of +/:- <value> seconds. Type 1 seek to <value> % in the movie. Type 2 is a seek to an absolute position of <value> seconds.
audio_delay <value>
Adjust the audio delay of value seconds
quit
Quit MPlayer
pause
Pause/:unpause the playback
grap_frames
Somebody know ?
pt_step <value> [force=<value>]
Go to next/:previous entry in the playtree.
pt_up_step <value> [force=<value>]
Like pt_step but it jumps to next/:previous in the parent list.
alt_src_step <value>
When more than one source is available it selects the next/:previous one (only supported by asx playlist).
sub_delay <value> [abs=<value>]
Adjust the subtitles delay of +/:- <value> seconds or set it to <value> seconds when abs is non zero.
osd [level=<value>]
Toggle osd mode or set it to level when level > 0.
volume <dir>
Increase/:decrease volume
[contrast|brightness|hue|saturation] <-100-100> [abs=<value>]
Set/:Adjust video parameters.
frame_drop [type=<value>]
Toggle/:Set frame dropping mode.
sub_visibility
Toggle subtitle visibility.
sub_pos <value>
Adjust subtitles position.
vo_fullscreen
Switch to fullscreen mode.
tv_step_channel <dir>
Select next/:previous tv channel.
tv_step_norm
Change TV norm.
tv_step_chanlist
Change channel list.
gui_[loadsubtitle|about|play|stop]
tv_start_scan
Start automatic TV channel scanning.
tv_step_channel <channel>
Select next/previous TV channel.
tv_step_norm
Change TV norm.
tv_step_chanlist
Change channel list.
tv_set_channel <channel>
Set the current TV channel.
tv_last_channel
Set the current TV channel to the last one.
tv_set_freq <frequency in MHz>
Set the TV tuner frequency.
tv_step_freq <frequency offset in MHz>
Set the TV tuner frequency relative to current value.
tv_set_norm <norm>
Set the TV tuner norm (PAL, SECAM, NTSC, ...).
tv_set_brightness <-100 - 100> [abs]
Set TV tuner brightness or adjust it if [abs] is set to 0.
tv_set_contrast <-100 -100> [abs]
Set TV tuner contrast or adjust it if [abs] is set to 0.
tv_set_hue <-100 - 100> [abs]
Set TV tuner hue or adjust it if [abs] is set to 0.
tv_set_saturation <-100 - 100> [abs]
Set TV tuner saturation or adjust it if [abs] is set to 0.
Самое главное для современной мультимедии - интеграция с LIRC (ифракрасным управлением).
Либо через горячие клавиши на основные действия (а уже на них привязать LIRC), либо (в идеале) напрямую интегрирваться с LIRC (с рисование пульта, тестирванием кодов и назначением клавиш).
PS : в Behold 607 инфракрасный датчик в linux представлен как клавиатура?
а в windows?
#repeat = 1
begin
prog = irexec
button = AUDIO
config = xmms&
mode = xmms
flags = once
end
begin
prog = irexec
button = VIDEO
config = gmplayer 1>/dev/null 2>/dev/null &
mode = mplayer
# config = smplayer 1>/dev/null 2>/dev/null &
# mode = smplayer
flags = once
end
#begin
# prog = irexec
# button = VIDEO
# config = tvtime
# mode = tvtime
# flags = once
#end
begin
prog = irexec
button = POWER
config = tvtime >/dev/null &
config = tvtime-command QUIT
mode = tvtime
flags = once
end
begin xmms
begin
prog = xmms
button = ENTER
config = PLAY
end
# begin
# prog = xmms
# button = clear
# config = PLAYLIST_CLEAR
# end
# begin
# prog = xmms
# button = load
# config = PLAYLIST_ADD .xmms/xmms.m3u
# end
begin
prog = xmms
button = MODE
config = PAUSE
end
begin
prog = xmms
button = SWAP
config = STOP
end
begin
prog = xmms
button = POWER
config = QUIT
flags = mode
end
begin
prog = xmms
button = CHAN_PLUS
config = NEXT
end
begin
prog = xmms
button = CHAN_MINUS
config = PREV
end
begin
prog = xmms
button = FORW
config = FWD 3
repeat = 2
end
begin
prog = xmms
button = BACK
config = BWD 3
repeat = 2
end
begin
prog = xmms
button = VOL_PLUS
config = VOL_UP 10
repeat = 2
end
begin
prog = xmms
button = VOL_MINUS
config = VOL_DOWN 10
repeat = 2
end
begin
prog = xmms
button = 1
config = ONE
end
begin
prog = xmms
button = 2
config = TWO
end
begin
prog = xmms
button = 3
config = THREE
end
begin
prog = xmms
button = 4
config = FOUR
end
begin
prog = xmms
button = 5
config = FIVE
end
begin
prog = xmms
button = 6
config = SIX
end
begin
prog = xmms
button = 7
config = SEVEN
end
begin
prog = xmms
button = 8
config = EIGHT
end
begin
prog = xmms
button = 9
config = NINE
end
begin
prog = xmms
button = 0
config = ZERO
end
begin
prog = xmms
button = RECALL
config = SETPOS
end
# Mute
begin
prog = xmms
button = MUTE
config = mute
end
end xmms
begin mplayer
# Show OSD
begin
prog = mplayer
button = SOURCE
# repeat = 3
config = osd
end
# Pause playback
begin
prog = mplayer
button = MODE
# repeat = 3
config = pause
end
# Skip ahead a minute if playing
# If paused, resume playing
begin
prog = mplayer
button = ENTER
# repeat = 3
config = seek +1
end
# Stop playback
begin
prog = mplayer
button = SWAP
# repeat = 3
config = seek 0 1\npause
end
# Mute
begin
prog = mplayer
button = MUTE
# repeat = 3
config = mute
end
# Seek back 10 seconds
begin
prog = mplayer
button = BACK
# repeat = 3
config = seek -10
end
begin
prog = mplayer
button = FORW
# repeat = 3
config = seek +30
end
# Quit
begin
prog = mplayer
button = POWER
# repeat = 3
config = quit 166
#flags = mode
end
# Replay
begin
prog = mplayer
button = RECALL
# repeat = 3
config = seek -7000
end
# Toggle full-screen
begin
prog = mplayer
button = ZOOM
repeat = 3
config = vo_fullscreen
end
begin
button = VOL_PLUS
prog = mplayer
config = volume 1
repeat = 1
end
begin
button = VOL_MINUS
prog = mplayer
config = volume -1
repeat = 1
end
begin
prog = mplayer
button = CHAN_PLUS
config = pt_step +1
end
begin
prog = mplayer
button = CHAN_MINUS
config = pt_step -1
end
begin
prog = mplayer
button = 1
config = contrast -1
repeat = 1
end
begin
prog = mplayer
button = 2
config = contrast +1
repeat = 1
end
begin
prog = mplayer
button = 5
config = brightness -1
repeat = 1
end
begin
prog = mplayer
button = 6
config = brightness +1
repeat = 1
end
begin
prog = mplayer
button = 9
config = saturation -1
repeat = 1
end
begin
prog = mplayer
button = 0
config = saturation +1
repeat = 1
end
end mplayer
begin tvtime
# begin
# prog = irexec
# button = POWER
# config = tvtime &
# config = tvtime-command QUIT
# end
# The following defines most of the common buttons found on a remote and
# what commads they would map to inside tvtime.
begin
prog = irexec
button = SOURCE
config = tvtime-command TOGGLE_INPUT
end
begin
prog = irexec
button = MODE
config = tvtime-command SHOW_MENU
# repeat = 1
end
begin
prog = irexec
button = ZOOM
config = tvtime-command TOGGLE_FULLSCREEN
end
begin
prog = irexec
button = SWAP
config = tvtime-command AUTO_ADJUST_PICT
end
begin
prog = irexec
button = MUTE
config = tvtime-command TOGGLE_MUTE
end
# Menu navigation.
begin
prog = irexec
button = CHAN_PLUS
config = tvtime-command UP
repeat = 1
end
begin
prog = irexec
button = CHAN_MINUS
config = tvtime-command DOWN
repeat = 1
end
begin
prog = irexec
button = VOL_PLUS
config = tvtime-command RIGHT
repeat = 2
end
begin
prog = irexec
button = VOL_MINUS
config = tvtime-command LEFT
repeat = 2
end
begin
prog = irexec
button = RECALL
config = tvtime-command CHANNEL_JUMP
repeat = 1
end
begin
prog = irexec
button = 1
config = tvtime-command CHANNEL_1
end
begin
prog = irexec
button = 2
config = tvtime-command CHANNEL_2
end
begin
prog = irexec
button = 3
config = tvtime-command CHANNEL_3
end
begin
prog = irexec
button = 4
config = tvtime-command CHANNEL_4
end
begin
prog = irexec
button = 5
config = tvtime-command CHANNEL_5
end
begin
prog = irexec
button = 6
config = tvtime-command CHANNEL_6
end
begin
prog = irexec
button = 7
config = tvtime-command CHANNEL_7
end
begin
prog = irexec
button = 8
config = tvtime-command CHANNEL_8
end
begin
prog = irexec
button = 9
config = tvtime-command CHANNEL_9
end
begin
prog = irexec
button = 0
config = tvtime-command CHANNEL_0
end
begin
prog = irexec
button = BACK
config = tvtime-command BRIGHTNESS_DOWN
end
begin
prog = irexec
button = FORW
config = tvtime-command BRIGHTNESS_UP
end
begin
prog = irexec
button = ENTER
config = tvtime-command MENU_ENTER
end
end tvtime
begin audacious
begin
prog = audacious
button = ENTER
config = PLAY
end
# begin
# prog = audacious
# button = clear
# config = PLAYLIST_CLEAR
# end
# begin
# prog = audacious
# button = load
# config = PLAYLIST_ADD .audacious/audacious.m3u
# end
begin
prog = audacious
button = MODE
config = PAUSE
end
begin
prog = audacious
button = SWAP
config = STOP
end
begin
prog = audacious
button = POWER
config = QUIT
flags = mode
end
begin
prog = audacious
button = CHAN_PLUS
config = NEXT
end
begin
prog = audacious
button = CHAN_MINUS
config = PREV
end
begin
prog = audacious
button = FORW
config = FWD 3
repeat = 2
end
begin
prog = audacious
button = BACK
config = BWD 3
repeat = 2
end
begin
prog = audacious
button = VOL_PLUS
config = VOL_UP 10
repeat = 2
end
begin
prog = audacious
button = VOL_MINUS
config = VOL_DOWN 10
repeat = 2
end
begin
prog = audacious
button = 1
config = ONE
end
begin
prog = audacious
button = 2
config = TWO
end
begin
prog = audacious
button = 3
config = THREE
end
begin
prog = audacious
button = 4
config = FOUR
end
begin
prog = audacious
button = 5
config = FIVE
end
begin
prog = audacious
button = 6
config = SIX
end
begin
prog = audacious
button = 7
config = SEVEN
end
begin
prog = audacious
button = 8
config = EIGHT
end
begin
prog = audacious
button = 9
config = NINE
end
begin
prog = audacious
button = 0
config = ZERO
end
begin
prog = audacious
button = RECALL
config = SETPOS
end
# Mute
begin
prog = audacious
button = MUTE
config = mute
end
end audacious
begin smplayer
# Show OSD
begin
prog = smplayer
button = SOURCE
config = smplayer -send-action osd_total
end
# Pause playback
begin
prog = smplayer
button = MODE
config = smplayer -send-action pause
end
# Skip ahead a minute if playing
# If paused, resume playing
begin
prog = smplayer
button = ENTER
config = smplayer -send-action play_or_pause
end
# Stop playback
begin
prog = smplayer
button = SWAP
config = smplayer -send-action pause
end
# Mute
begin
prog = smplayer
button = MUTE
config = smplayer -send-action mute
end
# Seek back 10 seconds
begin
prog = smplayer
button = BACK
config = smplayer -send-action rewind1
end
begin
prog = smplayer
button = FORW
config = smplayer -send-action forward1
end
# Quit
begin
prog = smplayer
button = POWER
config = smplayer -send-action close
flags = mode
end
# Replay
begin
prog = smplayer
button = RECALL
config = smplayer -send-action repeat
end
# Toggle full-screen
begin
# prog = smplayer
prog = irxevent
button = ZOOM
# config = smplayer -send-action fullscreen
config = Key f smplayer
end
begin
button = VOL_PLUS
prog = smplayer
config = smplayer -send-action increase_volume
repeat = 1
end
begin
button = VOL_MINUS
prog = smplayer
config = smplayer -send-action decrease_volume
repeat = 1
end
begin
prog = smplayer
button = CHAN_PLUS
config = smplayer -send-action play_next
end
begin
prog = smplayer
button = CHAN_MINUS
config = smplayer -send-action play_prev
end
begin
prog = smplayer
button = 1
config = smplayer -send-action dec_contrast
repeat = 1
end
begin
prog = smplayer
button = 2
config = smplayer -send-action inc_contrast
repeat = 1
end
begin
prog = smplayer
button = 5
config = smplayer -send-action dec_brightness
repeat = 1
end
begin
prog = smplayer
button = 6
config = smplayer -send-action inc_brightness
repeat = 1
end
begin
prog = smplayer
button = 9
config = smplayer -send-action dec_saturation
repeat = 1
end
begin
prog = smplayer
button = 0
config = smplayer -send-action inc_saturation
repeat = 1
end
end smplayer
# To find out how to get a proper configuration file please read:
#
# /usr/share/doc/lirc/README.Debian
# Please make this file available to others
# by sending it to <lirc@bartelmus.de>
#
# this config file was automatically generated
# using lirc-0.8.0(userspace) on Sun Feb 17 21:37:50 2008
#
# contributed by
#
# brand: /tmp/my_remote
# model no. of remote control:
# devices being controlled by this remote:
#
begin remote
name /tmp/my_remote
bits 16
eps 30
aeps 100
one 0 0
zero 0 0
pre_data_bits 16
pre_data 0x8001
gap 207435
toggle_bit 0
begin codes
1 0x0002
2 0x0003
3 0x0004
4 0x0005
5 0x0006
6 0x0007
7 0x0008
8 0x0009
9 0x000A
0 0x000B
MODE 0x0175
SWAP 0x0173
SOURCE 0x0182
CHAN_PLUS 0x0192
RECALL 0x0081
VIDEO 0x0189
VOL_MINUS 0x0072
ENTER 0x001C
VOL_PLUS 0x0073
AUDIO 0x0188
ZOOM 0x0174
CHAN_MINUS 0x0193
BACK 0x009E
FORW 0x009F
POWER 0x0074
MUTE 0x0071
end codes
end remote
# To find out how to get a proper configuration file please read:
#
# /usr/share/doc/lirc/README.Debian
PROTOCOL IntelliMouse
#PROTOCOL MouseSystems
# ACCELERATOR start max multiplier
ACCELERATOR 2 30 5
ACTIVATE * MENU
MOVE_N * 2
MOVE_NE * 3
MOVE_E * 6
MOVE_SE * 9
MOVE_S * 8
MOVE_SW * 7
MOVE_W * 4
MOVE_NW * 1
MOVE_N * ARROW_UP
MOVE_E * ARROW_RIGHT
MOVE_S * ARROW_DOWN
MOVE_W * ARROW_LEFT
MOVE_IN * CH_UP
MOVE_OUT * CH_DOWN
BUTTON1_TOGGLE * 5
BUTTON2_TOGGLE * 0
BUTTON3_TOGGLE * LIST
BUTTON1_CLICK * OK
BUTTON1_CLICK * MUTE
BUTTON3_CLICK * POWER
# BUTTONx_CLICK, BUTTONx_UP, BUTTONx_DOWN are also possible
вот-вот. именно, поэтому с пультом пока не спешу связываться, нет единого решения ...
ребята тут обещали тв-тюнером поделиться. Если притаранят - можно будет и с tv:/ разбираться
вот-вот. именно, поэтому с пультом пока не спешу связываться, нет единого решения ...
procedure tmplayer.stop;
begin
fpausing := false;
fplaying := false;
if fterm.running then
begin
debug('STOP');
fterm.writestrln('quit');
fterm.waitforprocess();
application.processmessages;
if fterm.running then
begin
debug('STOP: send kill signal');
fterm.killprocess;
if fterm.running then debug('STOP: can`t stop process, maybe zomby');
end;
end;
end;
, а quit отдельноfterm.writestrln('stop');
coyot.rush писал(а):Может всетаки, а quit отдельноfterm.writestrln('stop');
[root@server xelplayer9.2]# mplayer -slave -quiet /mnt/data/s2.mpeg
MPlayer SVN-r31303-4.5.0 (C) 2000-2010 MPlayer Team
.....
stop
Exiting... (End of file)
[root@server xelplayer9.2]#
[root@server xelplayer9.2]# mplayer -slave -quiet /mnt/data/s2.mpeg
MPlayer SVN-r31303-4.5.0 (C) 2000-2010 MPlayer Team
...
quit
Exiting... (Quit)
[root@server xelplayer9.2]#
coyot.rush писал(а):Возник вопрос по Mplayer'у. допустим воспроизводился фильм, как затем его в режим tv перевести , просто tv_set_freq value?
Удалять, перемещать и добавлять записи в tstringlist, думается, каждому по-плечу.
stop-Stop playback.
quit [value]
Quit MPlayer. The optional integer [value] is used as the return code
for the mplayer process (default: 0)
хороший вопрос, отвечу когда тв-тюнер притащат
Вернуться в Разработки на нашем сайте
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 7