前言
由于NAS下载影片较多,导致了203找影片需要翻页很多次,好在203的排序是按文件名(吐槽下先锋完全是乱序),还是可以相对轻松翻到。
但是很多种子命名都是乱来的,看文件名完全无法理解是什么影片(有做种需求,所以无法修改文件名),所以自行做了搜刮匹配数据后的海报墙。在每次看影片时需要先搜索到对应的文件名,再到播放器去寻找,还是比较麻烦。
当发现机器有RS232接口时,瞬间找到了希望,官方很良心的提供了完整的操作文档,并且还提供了TCP协议[1],操作起来更加便捷。
本文最终实现效果为,在点击海报墙的同时 播放器自动播放影片。
OPPO RS-232 & IP 控制协议
232部分,本文略过,详见页尾文档
这部分协议提供了完整的操控方法,但无法满足我的需求,所以使用了APP的协议,细节可看到下一章节。
播放器广播
播放器联网后,会通过UDP每十秒的间隔向局域网内7624端口广播自己的连接信息(其中换行为\n)
Notify:OPPO Player Start
Server IP:192.168.1.2
Server Port:23
Server Name:OPPO UDP-203
与播放器连接
我们收到广播之后,可以根据播放器发送的IP,port并使用TCP连接,如果是固定IP可以直接连接 ,忽略广播。
注:此处23端口为固定,且非Telnet
发送/接收指令
消息体已#开头,\n结束
示例
ASCII:#EJT\n
HEX:23 45 4a 54 0a
发送后播放器会返回
ASCII:OK OPEN\n
HEX:4f 4b 20 4f 50 45 4e 0a
详细操控指令
此章节略长,由于原版为英文,存在个人翻译不准确,仅供参考,可以在页尾查看官方文档
按键类
指令 | 遥控按键 | 功能 | 响应示例 |
---|---|---|---|
POW | POWER | 切换电源待机/开启 | OK ON OK OFF |
EJT | OPEN | 弹出/收起碟仓 | OK OPEN OK CLOSE |
PON | ON | Discrete on | OK ON |
POF | OFF | Discrete off | OK OFF |
DIM | DIMMER | 前面板显示屏变暗 | OK ON OK DIM OK OFF |
PUR | PURE | 纯音频模式(无视频 | OK ON OK OFF |
VUP | VOL + | 调大音量 | OK n (n是音量 范围:0 – 100) |
VDN | VOL - | 调小音量 | OK n (n是音量 范围:0 – 100) |
MUT | MUTE | 静音 | OK MUTE OK UNMUTE |
NU1 | 1 | 数字按键1 | OK |
NU2 | 2 | 数字按键2 | OK |
NU3 | 3 | 数字按键3 | OK |
NU4 | 4 | 数字按键4 | OK |
NU5 | 5 | 数字按键5 | OK |
NU6 | 6 | 数字按键6 | OK |
NU7 | 7 | 数字按键7 | OK |
NU8 | 8 | 数字按键8 | OK |
NU9 | 9 | 数字按键9 | OK |
NU0 | 0 | 数字按键0 | OK |
CLR | CLEAR | 清除数字输入 | OK |
GOT | GOTO | Play from a specified location | OK |
HOM | HOME | 进入主菜单 | OK |
PUP | PAGE UP | 显示上一页 | OK |
PDN | PAGE DOWN | 显示下一页 | OK |
OSD | INFO | 显示/隐藏屏幕显示 | OK |
TTL | TOP MENU | 显示BD顶部菜单或DVD标题 | OK |
MNU | POP-UP MENU | 显示BD弹出菜单 | OK |
NUP | Up Arrow | 上键 | OK |
NLT | Left Arrow | 左键 | OK |
NRT | Right Arrow | 右键 | OK |
NDN | Down Arrow | 下键 | OK |
SEL | ENTER | 确定 | OK |
SET | SETUP | 进入播放器设置菜单 | OK |
RET | RETURN | 返回上级菜单或模式 | OK |
RED | RED | 红色功能按键 | OK |
GRN | GREEN | 绿色功能按键 | OK |
BLU | BLUE | 蓝色功能按键 | OK |
YLW | YELLOW | 黄色功能按键 | OK |
STP | STOP | 停止 | OK |
PLA | PLAY | 开始 | OK |
PAU | PAUSE | 暂停 | OK |
PRE | PREV | Skip to previous | OK |
REV | REV | 快退 | OK 1X |
FWD | FWD | 快进 | OK 1X |
NXT | NEXT | Skip to next | OK |
AUD | AUDIO | 声音 | OK |
SUB | SUBTITLE | 字幕 | OK |
ANG | ANGLE | 改变摄像机角度 | OK a/b (a: 当前角度 b: 全部角度) |
ZOM | ZOOM | Zoom in/out and adjust aspect ratio |
OK (zoom ratio text) |
SAP | SAP | Turn on/off Secondary Audio Program |
OK (音轨信息) OK Off |
ATB | AB REPLAY | 重复播放所选部分 | OK AOK A-B OK OFF |
RPT | REPEAT | 重放 | OK Repeat Chapter OK Repeat Title OK OFF |
PIP | PIP | 显示/隐藏画中画 | OK (PIP program info) OK Off |
HDM | RESOLUTION | 切换输出分辨率 | OK |
SUH | SUBTITLE (按住) | 按住字幕键,进行字幕位移 | OK |
OPT | OPTION | 显示/隐藏选项菜单 | OK |
M3D | 3D | 显示/隐藏 2D转3D调整或3D调整菜单 | OK |
SEH | PIC | 显示图片调整菜单 | OK |
HDR | HDR | 显示 HDR 选择菜单 | OK |
INH | INFO (按住) | 显示详细信息 | OK |
RLH | RESOLUTION (按住) |
将分辨率设为自动 | OK |
AVS | Displaythe A/V Sync adjustment menu |
OK | |
GPA | 无缝播放 | OK | |
NOP | 空操作 | OK | |
SRC | INPUT | 显示输入菜单 例:#SRC followed by #NU1 |
OK |
查询类
指令 | 功能 | 响应示例 |
---|---|---|
QVM | Query verbose mode | OK 0 OK 1 OK 2 OK 3 |
QPW | 查询电源状态 | OK ON OK OFF |
QVR | 查询固件版本 | OK UDP20X-xx-xxxx |
QVL | 查询音量 | OK 100 OK MUTE |
QHD | 查询HDMI分辨率 | OK 480I OK 480P OK 576I OK 576P OK 720P50 OK 720P60 OK 1080I50 OK 1080I60 OK 1080P24 OK 1080P50 OK 1080P60 OK 1080PAUTO OK UHD24 OK UHD50 OK UHD60 OK UHD_AUTO OK AUTO OK Source Direct |
QPL | 查询播放状态 | OK PLAY OK PAUSE OK STOP OK STEP OK FREV OK FFWD OK SFWD OK SREV OK SETUP OK HOME MENU OK MEDIA CENTER OK SCREEN SAVER OK DISC MENU |
QTK | Query Track/Title | OK 02/10 |
QCH | 查询章节 | OK 03/03 |
QTE | Query Track/Title elapsed time | OK 00:01:34 |
QTR | Query Track/Title remaining time | OK 01:20:23 |
QCE | Query Chapter elapsed time | OK 00:01:34 |
QCR | Query Chapter remaining time | OK 00:12:22 |
QEL | Query Total elapsed time | OK 00:05:12 |
QRE | Query Total remaining time | OK 01:34:44 |
QDT | Query disc type | OK BD-MV OK DVD-VIDEO OK DVD-AUDIO OK SACD OK CDDA OK DATA-DISC OK UHBD OK NO-DISC OK UNKNOW-DISC |
QAT | Query audio type | OK DD 1/1 OK DD 1/5 English OK DTS 2/5 English OK LPCM OK DTS-HD 1/4 English |
QST | Query subtitle type | OK OFF OK 1/1 English |
QSH | Query subtitle shift | OK -10 (valid returns are -10 .. 0 .. 10) |
QOP | Query OSD position | OK 0 (valid returns are 0 .. 5) |
QRP | Query Repeat Mode | OK 00 Off (OK followed by a repeat mode code and text: 00 Off 01 Repeat One 02 Repeat Chapter 03 Repeat All 04 Repeat Title 05 Shuffle 06 Random) |
QZM | Query Zoom Mode | OK 00 (OK followed by a zoom mode code: 00 Off 01 Stretch 02 Full 03 Underscan 04 1.2x 05 1.3x 06 1.5x 07 2x 08 3x 09 4x 10 1/2 11 1/3 12 1/4) QHR Query HDR Setting OK Auto OK On OK Off OK StripMetadata |
Q3D | Query 3D Status | OK 2D OK 3D (returns the actual video output status) |
QHS | Query HDR Status | OK HDR OK SDR OK DOV (returns the actual video output status) |
QIS | Query Input Source | OK 0 BD-PLAYER OK 1 HDMI-IN OK 2 ARC-HDMI-OUT OK 3 OPTICAL-IN OK 4 COAXIAL-IN OK 5 USB-AUDIO-IN (Return the currently selected input source) |
QCD | Query CDDB number | QC1 OK XXYY QC2 OK YYZZ ER INVALID (OK followed by the CDDB number of the CD being played) |
QFT | Query media file format | OK FLAC OK WAV OK MKV OK JPG (OK followed by the media file format) ER INVALID |
QFN | Query media file name | OK Rocky Mou*.wav (OK followed by the file name) ER INVALID |
QTN | Query track name | OK Rocky Mountain* (OK followed by the current track name) ER INVALID |
QTA | Query track album | OK Rise And Fall, Rage* (OK followed by the current track album) ER INVALID |
QTP | Query track performer | OK The Offspring (OK followed by the current track performer) ER INVALID |
QDS | Query directory size | OK 120 (OK followed by the number of entries in the current directory. This command is only valid when the player is navigating a data disc, USB drive or network share.) ER INVALID |
QAR | Query aspect ratio setting | OK 16WW (16:9 Wide) OK 16AW (16:9 Wide Auto, currently wide) OK 16A4 (16:9 Wide Auto, currently playing 4:3) OK 21M0 (21:9 Movable, currently full screen mode) OK 21M1 (21:9 Movable, currently playing 16:9 or 4:3 content) OK 21M2 (21:9 Movable, currently playing 21:9 content) OK 21F0 (21:9 Fixed, currently full screen mode) OK 21F1 (21:9 Fixed, currently playing 16:9 or 4:3 content) OK 21F2 (21:9 Fixed, currently playing 21:9 content) OK 21C0 (21:9 Cropped, currently full screen mode) OK 21C1 (21:9 Cropped, currently playing 16:9 or 4:3 content) OK 21C2 (21:9 Cropped, currently playing 21;9 content) |
专家类
指令 | 参数 | 功能 | 响应示例 |
---|---|---|---|
SVM | 0 1 2 3 |
0 – Set Verbose Mode to off 1 – Not in use (for backwards compatibility) 2 – Enable unsolicited status updates. Only major status changes are reported. 3 – Enable detailed status updates. When content is playing, the player sends out playback time updates every second. |
OK 0 OK 1 OK 2 OK 3 |
SHD | AUTO SRC UHD_AUTO UHD24 UHD50 UHD60 1080P_AUTO 1080P24 1080P50 1080P60 1080I50 1080I60 720P50 720P60 576P 576I 480P 480I |
Set HDMI output resolution. If a custom resolution parameter is given, this command changes the “Custom Resolution” setting in the Setup Menu and sets the “Output Resolution” to “Custom” at the same time. |
OK 480P (OK followed by the original parameter) |
SZM | 1 AR FS US 1.2 1.3 1.5 2 1/2 3 4 1/3 1/4 |
Set zoom ratio. AR – Aspect ratio correction (Stretch, Letterbox or Pillarbox) FS – Full Screen US – Under scan 1, 1.2, 1.3, 1.5, 2, 1/2 – Specified zoom ratio. (When the TV Aspect Ratio is set to 21:9 Movable/Fixed/Cropped in the Setup Menu, the only valid parameters are 1, AR, and FS. 1 for 16:9 mode, AR for 21:9 mode, and FS for full screen mode.) |
OK 1.2 (OK followed by the zoom ratio) ER INVALID |
SVL | 0 – 100 MUTE |
Set volume control | OK 100 OK MUTE |
SRP | CH TT ALL OFF SHF RND |
Repeat chapter Repeat title or CD track Repeat all Repeat off Shuffle Random |
OK CH (OK followed by the repeat mode) ER INVALID |
SRH | T3 C10 C 0:00:34 T 0:12:13 0:12:13 |
Search to Title 3 Search to Chapter 10 Search to 0:00:34 of the current chapter or track Search to 0:12:13 of the current title or disc Search to 0:12:13 of the current title or disc |
OK ER INVALID |
DPL | Direct play | OK | |
RST | Reset Command – Clean all command buffers, do not wait for any pending/executing commands. Start over again. |
OK | |
SSH | -10 ... 10 | Set subtitle shift | OK -10 (OK followed by the shift level) ER INVALID |
SOP | 0 … 5 | Set OSD position | OK 5 (OK followed by the position value) ER INVALID |
STC | E R T X C K |
Set the time information display: E – Total Elapsed time R – Total Remaining time T – Title Elapsed time X – Title Remaining time C – Chapter/track Elapsed time K – Chapter/track Remaining time |
OK E (OK followed by the display type) ER INVALI |
SHR | Auto On Off |
Set HDR setting | OK Auto |
SIS | 0 1 2 3 4 5 |
Select the input source: 0 – Blu-ray player 1 – HDMI IN 2 – ARC: HDMI OUT 3 – OPTICAL IN 4 – COAXIAL IN 5 – USB AUDIO IN (Parameters 3 – 5 are only available for UDP-205) |
OK 0 BD-PLAYER OK 1 HDMI-IN OK 2 ARC-HDMI-OUT OK 3 OPTICAL-IN OK 4 COAXIAL-IN OK 5 USB-AUDIO-IN ER INVALID |
SSA | ON OFF SAVE |
Set the parameters for Screen Saver in the Setup Menu – Playback Setup – Screen Saver. |
OK ON OK OFF OK SAVE ER INVALID |
APP | DIS MUS PHO MOV NET SET |
Stop current playback and start the corresponding application from the home menu: DIS – Disc MUS – Music PHO – Photo MOV – Movie NET – Network SET – Setup |
OK DIS (OK followed by the application) ER INVALID |
SSD | M S C |
Set SACD Priority. Possible parameters are: M – Multi-channel S – Stereo C – CD Mode (This command changes the Setup Menu setting for SACD Priority. The setting takes effect the next time an SACD is loaded into the player. If an SACD is already in the player, this setting does not immediately change the playback priority.) |
OK M (OK followed by the set value) ER INVALID |
SDP | D P A |
Set the SACD output mode: D – Output DSD P – Output PCM A – Automatically decides between PCM or DSD based on connected devices’ compatibility. (This command changes the Setup Menu setting for SACD Output. If an SACD is playing, the output will be changed on the fly.) |
OK D (OK followed by the output mode) ER INVALID |
FWD | 1/32 1/16 1/8 1/4 1/2 1 2 3 4 5 |
Set Fast/Slow Forward Play speed. | OK 1/32 (OK followed by the forward speed) ER INVALID |
REV | 1/32 1/16 1/8 1/4 1/2 1 2 3 4 5 |
Set Fast/Slow Reverse Play speed. | OK 1/32 (OK followed by the forward speed) ER INVALID (Slow reverse is not available for UHD content) |
QDR | 1 … xxx | Query directory item. The parameter is the index number of the file or item in the current directory listing. |
OK U USB1 (USB Device) OK O CDDA (Optical Disc) OK 0 .. (Upper Level) OK F Rocky-mou*.wav (File) OK D My Music (Directory) OK 0 My Network Search (Network) OK L oShare_MediaSer* (DLNA server) OK S MyPC (SMB server) OK N MyNFS (NFS server) |
APP 控制协议
虽然官方提供了完整的协议,但是未能达到我搜索指定影片并且播放的目的,OPPO有提供一个APP ‘MediaControl’[2][3] 用APP可以在局域网操控播放器。通过破解协议,我整理出另外一套HTTP协议,可以与官方提供的协议进行互补。
APP广播激活协议
首先要广播协议,播放器接收后,会激活HTTP协议,建议多次广播,在收到播放器返回消息后,停止广播。
首先我们在局域网向255.255.255.255进行UDP广播
ASCII:NOTIFY OREMOTE LOGIN
HEX:4e 4f 54 49 46 59 20 4f 52 45 4d 4f 54 45 20 4c 4f 47 49 4e
当播放器收到广播时会返回
ASCII:UDP-203_OPPO UDP-203 REPORT ADDRESS TO OREMOTE: 192.168.1.2:19999
HEX:55 44 50 2d 32 30 33 5f 4f 50 50 4f 20 55 44 50 2d 32 30 33 20 52 45 50 4f 52 54 20 41 44 44 52 45 53 53 20 54 4f 20 4f 52 45 4d 4f 54 45 3a 20 31 39 32 2e 31 36 38 2e 31 2e 32 3a 31 39 39 39 39
HTTP协议端口
协议被激活后,会开启436端口,我们通过436端口可以进行HTTP操作,并返回JSON结果
HTTP协议内容
我整理出部分HTTP协议,不是很完全,欢迎补充
协议使用GET方法,如需带参数,则在问号后加入json格式
示例
192.168.1.2:436/signin?%7B%22appIpAddress%22%3A%2210.254.254.254%22%2C%22appIconType%22%3A1%7D
方法 | 功能 | 参数 | 响应示例 |
---|---|---|---|
getmainfirmwareversion | 获取固件版本 | {"success":true,"player_style":"UDP-203","bbkver":"20XCN-65-0132"} | |
getvolume | 获取音量 | {"Success": true, "msg": "", "curr_volume": 40, "min_volume": 0, "max_volume": 100, "is_muted": false} | |
getglobalinfo | 获取全局信息 | {"success":true,"curr_volume":100,"min_volume":0,"max_volume":100,"is_muted":false,"cur_media_type":5,"is_audio_playing":false,"gapless_play_mode":0,"is_pic_playing":false,"is_video_playing":false,"is_bdmv_playing":false,"is_disc_playing":false,"output_volume_mode":"variable","activeapp":"mediac","msg":""} | |
getsetupmenu | 获取设置菜单 | {"success":true,"msg":"setting done"} | |
getdevicelist | 获取设备列表 | {"success":true,"msg":"","devicelist":[{"sub_type":"cifs","name":"SYNOLOGY-NAS","path":"SYNOLOGY-NAS","serial_number":"","logic_part_idx":"0","total_size_bytes":"0","avail_size_bytes":"0","partition_info":""}]} | |
getFavoriteDBFile | 获取收藏文件 | {"success":true} | |
getdvdbdgninfo | {} | ||
getmovieplayinfo | 获取影片播放信息 | {"success":true,"msg":"","playinfo":{"bd_file_path":"/mnt/nfs1/FILE_DIR/DISC1","file_path":"BDISO","e_play_status":0,"e_play_mode":0,"cur_time":4,"total_time":6005}} | |
getplayingtime | 获取播放时间 | {"success":true,"msg":"","media_type":13,"cur_time":4,"total_time":6005,"disc_cur_time":0,"disc_total_time":0} | |
getSambaShareFolderlist | 获取Samba文件夹 | 略 | |
getmoviefileusercoverisready | {"success":true,"hasCover":false} | ||
signin | APP登录,执行后自动获取网络设备,播放器会有提示 | {"appIpAddress":"192.168.1.3","appIconType":1} | {"success":true,"msg":"","player_name":"UDP-203_OPPO UDP-203","player_port":"436"} |
sendremotekey | 发送遥控按键,KEY可以参考232部分 | {"key":"SEL"} | {"success":true,"msg":""} |
loginSambaWithOutID | {"serverName":"SYNOLOGY-NAS"} | {"success":true,"retInfo":""} | |
mountSharedFolder | 挂载SMB目录 | {"bWithID":false,"password":"defaultPassword&withoutPassword","bRememberID":false,"folder":"video","server":"SYNOLOGY-NAS","userName":"defaultUserName&withoutUserName"} | {"success":true,"retInfo":"","cifsMntPath":"/mnt/cifs1","server":"SYNOLOGY-NAS","folder":"video"} |
loginNfsServer | 登陆NFS服务器 | {"serverName":"192.168.1.1"} | {"success":true,"retInfo":""} |
mountNfsSharedFolder | 挂载NFS目录 | {"server":"192.168.1.1","folder":"volume1/DIR"} | {"success":true,"retInfo":"","nfsMntPath":"/mnt/nfs1","server":"192.168.1.1","folder":"volume1/DIR"} |
checkfolderhasbdmv | 播放bdmv目录 | {"folderpath":"/mnt/nfs1/BDMV_PATH"} | |
playnormalfile | 播放文件 | {"path":"/mnt/nfs1/FILE_DIR/FILE.iso","playMode":0,"extraNetPath":"init","appDeviceType":6,"type":1,"index":0} | |
getfilelist | 获取文件列表 | {"mediatype":3,"flag":3,"filetype":1,"path":"/mnt/cifs1","deviceSubType":7} | 略 |
getUsbMediaCover | {"type":2,"fullName":"/mnt/cifs1/FILE_DIR/FILE.iso"} |
最后
最终我使用了HTTP的playnormalfile/checkfolderhasbdmv方法,实现了海报墙点击联动播放器播放。不在为寻片而苦恼。
由于每次开机都需要激活HTTP协议,所以我将播放器设为固定IP,在检测到IP连通后,广播APP的UDP协议,实现了开机即激活。
NFS共享播放流程
1.signin
2.等待getdevicelist发现NFS设备
3.loginNfsServer 登陆nfs服务器
4.mountNfsSharedFolder 挂载nfs目录
5.getfilelist 逐级获取文件列表
6.playnormalfile / checkfolderhasbdmv 播放文件