Playing video

Asked by JCC_Starguy

I have tried to write a script to play a short video and I think I've used the correct syntax with this line:

external_viewer action play alpha 1 altitude 45 azimuth 180 coordinate_system dome filename MPEG-2.mpg scale 30 duration 32

A small window pops up over the main window telling me that it's launched the external player but in my terminal window, it reads:

sh: /usr/local/share/nightshade/data/script_external_viewer: No such file or directory

So I'm at a loss.

Any suggestions?

Question information

Language:
English Edit question
Status:
Answered
For:
Nightshade Legacy Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Rob Spearman (rob-digitaliseducation) said :
#1

Video playback has to be provided by a separate application.

To launch a video player you would need to create a data/script_external_viewer program (for example, a shell script on Linux) that can interface with your preferred video player.

Nightshade will call script_external_viewer with command line arguments of "start" and then the filename of the video. Other command line options you need to support are "pause", "resume", and "stop". Stop should exit the video player.

It is only on Digitarium OP3 platform planetarium systems where the altitude, azimuth, etc. parameters are supported as explained in the StratoScript command reference. If you think anything could be clearer there let me know.

Rob

Revision history for this message
JCC_Starguy (guns-n-neuroses) said :
#2

Rob, can you recommend a good external viewer program to go with Nightshade? I often use mplayer but can set up VLC or just about anything else.

Thanks,

Jim

Revision history for this message
Lionel RUIZ (astro2kpremium) said :
#3

Hello Starguy,

mplayer is fine to play videos. It's the best in my eyes.

As Rob said, you have to create an eXecutable file named "script_external_viewer" in the /data/ directory and containing for example this shell command:.

if [ "$1" = "start" ]; then mplayer -fs -osdlevel 0 $2 ; fi
if [ "$1" = "stop" ]; then killall mplayer ; fi

It's a bit harsh but it works. If someone has a better command to propose...

Best regards

Revision history for this message
lana99999 (fat5) said :
#4

Sorry, did you talk about Linux?

In which editor or programm I can create an eXecutable file named "script_external_viewer"?

Revision history for this message
Lionel RUIZ (astro2kpremium) said :
#5

Yes, Linux.

With shell commands written into a text editor, saved with the name "script_external_viewer" and eXecutable with the proper rights.

>chmod +x script_external_viewer

On a prompt for example, I think that it works (or with a contextual menu option on the file).

Revision history for this message
Tomasz Lewicki (stalkerpl) said :
#6

Is it any method to get rid of "starting external viewer" window on Linux version when scripts starts to play video file?

Revision history for this message
Tomasz Lewicki (stalkerpl) said :
#7

I found the solution: piece of code needs to be commented out in src/app_command_interface.cpp

From

#ifdef DESKTOP
   stapp->ui->show_message("Started external viewer:\n\n" +
                           args["filename"], 5000);
#endif

to:

/* #ifdef DESKTOP
   stapp->ui->show_message("Started external viewer:\n\n" +
                           args["filename"], 5000);
#endif */

Can you help with this problem?

Provide an answer of your own, or ask JCC_Starguy for more information if necessary.

To post a message you must log in.