Difference between revisions of "GStreamer Daemon - Javascript Video Player Example"
m (Fix typos and order) |
|||
Line 12: | Line 12: | ||
==Usage== | ==Usage== | ||
=== Server side === | === Server side === | ||
+ | A regular localhost setup will use just one computer with the following variables. You can also use a local area network to have multiple devices. | ||
+ | GSTD_ADDRESS=127.0.0.1 | ||
+ | GSTD_PORT=5000 | ||
+ | SERVER_ADDRESS=127.0.0.1 | ||
+ | SERVER_PORT=8000 | ||
+ | |||
Run gstd | Run gstd | ||
− | gstd --enable-http-protocol --http- | + | gstd --enable-http-protocol --http-address=${GSTD_ADDRESS} --http-port=${GSTD_PORT} |
Then move to web examples and run the server: | Then move to web examples and run the server: | ||
cd examples/web/ | cd examples/web/ | ||
− | + | ./setup_http_server.sh -a $SERVER_ADDRESS -p $SERVER_PORT | |
− | |||
− | ./setup_http_server.sh -a $ | ||
===Client side=== | ===Client side=== | ||
On your browser go to: | On your browser go to: | ||
− | http:// | + | http://127.0.0.1:8000/ (Use the IP and port that you configured in the last step) |
Now you can see the menu with the available examples | Now you can see the menu with the available examples | ||
− | + | On this page, you need to configure the IP and Port where GstD is running, in this case, IP=127.0.0.1 and Port=5000. | |
[[File:Menu html.png |900px|center|thumb|Menu gstd examples]] | [[File:Menu html.png |900px|center|thumb|Menu gstd examples]] | ||
====Example 1: Video player==== | ====Example 1: Video player==== | ||
− | Now select the first example "Video player" and you can see the following page. | + | Now select the first example "Video player" and you can see the following page. It is possible to enter the example without the menu, in that case it is necessary to configure the Address and port as shown in the picture. |
− | It | ||
[[File:Video_player.png | 900px |center|thumb]] | [[File:Video_player.png | 900px |center|thumb]] | ||
Line 47: | Line 50: | ||
* Playback direction ( > Forward, < backward ) | * Playback direction ( > Forward, < backward ) | ||
* Jump to a specific time | * Jump to a specific time | ||
− | * The console | + | * The console shows the errors, warnings, and logs of gstd |
====Example 2: GSTD Controller==== | ====Example 2: GSTD Controller==== | ||
Now select the second example "GSTD controller" and you can see the following page | Now select the second example "GSTD controller" and you can see the following page | ||
− | It | + | It is possible to enter the example without the menu, in that case it is necessary to configure the Address and port as shown in the picture. |
[[File:Gstd controller.png|900px|thumb|center|GSTD controller]] | [[File:Gstd controller.png|900px|thumb|center|GSTD controller]] | ||
Line 62: | Line 65: | ||
* Playback direction ( > Forward, < backward ) | * Playback direction ( > Forward, < backward ) | ||
* Jump to a specific time | * Jump to a specific time | ||
− | * The console | + | * The console shows the errors, warnings, and logs of gstd |
− | + | Advanced controls: | |
* Elements selection (Select the element to modify the properties) | * Elements selection (Select the element to modify the properties) | ||
* Property selection (Select the property that you want to modify) | * Property selection (Select the property that you want to modify) |
Revision as of 13:20, 7 July 2020
Contents
Introduction to GStreamer Daemon Javascript Video Player Example
This is one concrete usage example of the GStreamer Daemon along with a Javascript + HTML Application. In this case, the application uses the Javascript GSTD API to communicate with GStreamer Daemon through the HTTP server.
The application consists of a Simple Video Player with several capabilities:
- Select the input (Camera or video file)
- Regular and reverse video playback.
- Trick modes (fast-forward, speed change, seek to position).
- Read messages from the GSTD bus.
Usage
Server side
A regular localhost setup will use just one computer with the following variables. You can also use a local area network to have multiple devices.
GSTD_ADDRESS=127.0.0.1 GSTD_PORT=5000 SERVER_ADDRESS=127.0.0.1 SERVER_PORT=8000
Run gstd
gstd --enable-http-protocol --http-address=${GSTD_ADDRESS} --http-port=${GSTD_PORT}
Then move to web examples and run the server:
cd examples/web/
./setup_http_server.sh -a $SERVER_ADDRESS -p $SERVER_PORT
Client side
On your browser go to:
http://127.0.0.1:8000/ (Use the IP and port that you configured in the last step)
Now you can see the menu with the available examples On this page, you need to configure the IP and Port where GstD is running, in this case, IP=127.0.0.1 and Port=5000.
Example 1: Video player
Now select the first example "Video player" and you can see the following page. It is possible to enter the example without the menu, in that case it is necessary to configure the Address and port as shown in the picture.
Controls:
- Select the input
- Camera: Select the camera that you want to use, e.g. /dev/video0 .
- File: Select the video file that you want to use, e.g. /home/user/videos/video.mp4 .
- Create the pipelines
- Delete the pipeline
- Pay, Pause, Stop
- Speed
- Playback direction ( > Forward, < backward )
- Jump to a specific time
- The console shows the errors, warnings, and logs of gstd
Example 2: GSTD Controller
Now select the second example "GSTD controller" and you can see the following page It is possible to enter the example without the menu, in that case it is necessary to configure the Address and port as shown in the picture.
Controls:
- Pipeline e.g videotestsrc ! autovideosink
- Create the pipelines
- Delete the pipeline
- Pay, Pause, Stop
- Speed
- Playback direction ( > Forward, < backward )
- Jump to a specific time
- The console shows the errors, warnings, and logs of gstd
Advanced controls:
- Elements selection (Select the element to modify the properties)
- Property selection (Select the property that you want to modify)
- New value of the selected property
- Filter the bus
- Send an EOS
- Send a Flush Start and Stop
Add your own example