… | |
… | |
62 | $quit->recv; |
62 | $quit->recv; |
63 | |
63 | |
64 | This starts F<mpv> with the two arguments C<--> and C<$videofile>, which |
64 | This starts F<mpv> with the two arguments C<--> and C<$videofile>, which |
65 | it should load and play. It then waits two seconds by starting a timer and |
65 | it should load and play. It then waits two seconds by starting a timer and |
66 | quits. The C<trace> argument to the constructor makes F<mpv> more verbose |
66 | quits. The C<trace> argument to the constructor makes F<mpv> more verbose |
67 | and also prints the commands and responses, so you cna have an idea what |
67 | and also prints the commands and responses, so you can have an idea what |
68 | is going on. |
68 | is going on. |
|
|
69 | |
|
|
70 | In my case, the above example would output something like this: |
|
|
71 | |
|
|
72 | [uosc] Disabled because original osc is enabled! |
|
|
73 | mpv> {"event":"start-file","playlist_entry_id":1} |
|
|
74 | mpv> {"event":"tracks-changed"} |
|
|
75 | (+) Video --vid=1 (*) (h264 480x480 30.000fps) |
|
|
76 | mpv> {"event":"metadata-update"} |
|
|
77 | mpv> {"event":"file-loaded"} |
|
|
78 | Using hardware decoding (nvdec). |
|
|
79 | mpv> {"event":"video-reconfig"} |
|
|
80 | VO: [gpu] 480x480 cuda[nv12] |
|
|
81 | mpv> {"event":"video-reconfig"} |
|
|
82 | mpv> {"event":"playback-restart"} |
69 | |
83 | |
70 | This is not usually very useful (you could just run F<mpv> as a simple |
84 | This is not usually very useful (you could just run F<mpv> as a simple |
71 | shell command), so let us load the file at runtime: |
85 | shell command), so let us load the file at runtime: |
72 | |
86 | |
73 | use AnyEvent; |
87 | use AnyEvent; |