Difference between revisions of "Gst-play"

[quality revision] [quality revision]
m
 

1 Overview[edit]

gst-play (gst-play-1.0) is a GStreamer command line utility available with GStreamer-1.X.

This utility plays multimedia content using the Playbin element as a basic player. It takes as an input either individual files, URLs or a whole directories (in this case it will recurse into sub-directories as well).

2 Usage[edit]

gst-play accepts the following options:

Board $> gst-play-1.0 --help
Usage:
  gst-play-1.0 [OPTION?] FILE1|URI1 [FILE2|URI2] [FILE3|URI3] ...

Help Options:
  -h, --help                        Show help options
  --help-all                        Show all help options
  --help-gst                        Show GStreamer Options

Application Options:
  -v, --verbose                     Output status information and property notifications
  --flags                           Control playback behaviour setting playbin 'flags' property
  --version                         Print version information and exit
  --videosink                       Video sink to use (default is autovideosink)
  --audiosink                       Audio sink to use (default is autoaudiosink)
  --gapless                         Enable gapless playback
  --shuffle                         Shuffle playlist
  --no-interactive                  Disable interactive control via the keyboard
  --volume                          Volume
  --playlist                        Playlist file containing input media files
  -q, --quiet                       Do not print any output (apart from errors)

The user can control the playback through the host terminal keyboard. Press k to list the available keyboard shortcuts once the content is playing:

       <space>   Pause/Resume playback

       <up/down arrows>
               Volume up/down

       <left/right arrows>
               Seek back/forward

       +/-     Increase/decrease playback rate

       d       Reverse playback direction

       t       Cycle through trick modes

       a       Switch audio track

       s       Switch subtitle track

       v       Switch video track

       >       Skip to next item in playlist

       <       Go back to previous item in playlist

       q, ESC  Quit

Information provided by gst-play Ubuntu manual

3 Examples[edit]

Info.png Don't have /usr/local/demo/media/ST2297_visionv3.webm ? Follow instructions in this article.
Info.png To hear audio track, depending on the considered board, an audio headset must be plugged on

3.1 Basic audio/video playback[edit]

Board $> gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm

3.2 Video only playback[edit]

Board $> gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm --audiosink=fakesink

Audio rendering is disabled, but audio decoding continues.

3.3 Playlist playback[edit]

Board $> gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm /usr/local/demo/media/ST2297_visionv3.webm /usr/local/demo/media/ST2297_visionv3.webm /usr/local/demo/media/ST2297_visionv3.webm

Press ">" key to play the next file, "<" key to play the previous one.

3.4 Loop or repeat the same video[edit]

This option is not currently available within gst-play but here are some alternatives:

  • Playlist with the same video over and over. In the example below, the same video file is played 3 times. The video file can be added as many times as needed:
Board $> gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm /usr/local/demo/media/ST2297_visionv3.webm  /usr/local/demo/media/ST2297_visionv3.webm
  • For loop (here 1000 times):
Board $> for i in `seq 1 1000`;do gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm; done

3.5 Seek while playing[edit]

Board $> gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm /usr/local/demo/media/ST2297_visionv3.webm /usr/local/demo/media/ST2297_visionv3.webm /usr/local/demo/media/ST2297_visionv3.webm

Press "right arrow key" to seek forward, "left arrow key" to seek backward.

3.6 Change playback speed[edit]

Board $> gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm

Press "+" key to increase rate and "-" key to decreased it.

3.7 HTTP streaming[edit]

Info.png An internet connection is required, for example by plugging an Ethernet cable on


Board $> gst-play-1.0  https://github.com/STMicroelectronics/meta-st-openstlinux/blob/thud/recipes-samples/demo/demo-launcher/media/ST2297_visionv3.webm?raw=true


3.8 Audio/video playback on HDMI TV[edit]

Info.png Plug first HDMI TV cable as described in How to display on HDMI article


Switch audio output on HDMI:

Board $> pacmd set-card-profile 0 output:hdmi-stereo

Than play the video:

Board $> gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm

3.9 Audio/video playback in background[edit]

Option --no-interactive must be set in order to be able to play in background:

Board $> gst-play-1.0 /usr/local/demo/media/ST2297_visionv3.webm --no-interactive &
[1] 14998
root@stm32mp1:~# Now playing /av_h264_main_640x480_30fps_1000kbps_aac-lc_192kbps.mp4

Then to stop playback:

Board $> killall gst-play-1.0

or

Board $> fg
<CTRL+C>



== Overview ==
{{highlight|'''gst-play'''}} (gst-play-1.0) is a GStreamer command line utility available with GStreamer-1.X.

This utility plays multimedia content using the Playbin element as a basic player. It takes as an input either individual files, URLs or a whole directories (in this case it will recurse into sub-directories as well).

== Usage ==
gst-play accepts the following options:
 {{Board$}} gst-play-1.0 --help<pre>

Usage:
  gst-play-1.0 [OPTION?] FILE1|URI1 [FILE2|URI2] [FILE3|URI3] ...

Help Options:
  -h, --help                        Show help options
  --help-all                        Show all help options
  --help-gst                        Show GStreamer Options

Application Options:
  -v, --verbose                     Output status information and property notifications
  --flags                           Control playback behaviour setting playbin 'flags' property
  --version                         Print version information and exit
  --videosink                       Video sink to use (default is autovideosink)
  --audiosink                       Audio sink to use (default is autoaudiosink)
  --gapless                         Enable gapless playback
  --shuffle                         Shuffle playlist
  --no-interactive                  Disable interactive control via the keyboard
  --volume                          Volume
  --playlist                        Playlist file containing input media files
  -q, --quiet                       Do not print any output (apart from errors)</pre>


The user can control the playback through the host terminal keyboard. Press {{highlight|'''k'''}} to list the available keyboard shortcuts once the content is playing:<pre>
<space>   Pause/Resume playback
<up/down arrows>

               Volume up/down
<left/right arrows>

               Seek back/forward

       +/-     Increase/decrease playback rate

       d       Reverse playback direction

       t       Cycle through trick modes

       a       Switch audio track

       s       Switch subtitle track

       v       Switch video track

       >       Skip to next item in playlist
<       Go back to previous item in playlist

       q, ESC  Quit</pre>
Information provided by [http://manpages.ubuntu.com/manpages/wily/man1/gst-play-1.0.1.html gst-play Ubuntu manual]

== Examples ==
{{Info|Don't have ''{{av_ref_file}}'' ? Follow instructions in [[Template:Av_ref_file#Download_this_file|this article]].}}
{{Info|To hear audio track, depending on the considered board, an audio headset must be plugged on
* the [[STM32MP157xSTM32MP157C-EV1 - hardware description#MB1262-CN5|STM32MP157xSTM32MP157C-EV1 Evaluation board CN5 jack connector]]
* the [[STM32MP157x-DKxSTM32MP157X-DKX - hardware description#MB1272-CN10|STM32MP157x-DKxSTM32MP157X-DKX Discovery kit CN10 jack connector]]
}}{{UpdateNeededForNewBoard|Point to the jack connector (if any) of the new board}}

=== Basic audio/video playback ===
 {{Board$}} gst-play-1.0 {{av_ref_file}}

=== Video only playback ===
 {{Board$}} gst-play-1.0 {{av_ref_file}} --audiosink=fakesink
Audio rendering is disabled, but audio decoding continues.

=== Playlist playback ===
 {{Board$}} gst-play-1.0 {{av_ref_file}} {{av_ref_file}} {{av_ref_file}} {{av_ref_file}}
Press {{highlight|'''">" key'''}} to play the next file, {{highlight|'''"<" key'''}} to play the previous one.

=== Loop or repeat the same video ===
This option is not currently available within gst-play but here are some alternatives:
* Playlist with the same video over and over. In the example below, the same video file is played 3 times. The video file can be added as many times as needed:
 {{Board$}} gst-play-1.0 {{av_ref_file}} {{av_ref_file}}  {{av_ref_file}}
* For loop (here 1000 times):
 {{Board$}} for i in `seq 1 1000`;do gst-play-1.0 {{av_ref_file}}; done

=== Seek while playing ===
 {{Board$}} gst-play-1.0 {{av_ref_file}} {{av_ref_file}} {{av_ref_file}} {{av_ref_file}}
Press {{highlight|'''"right arrow key"'''}} to seek forward, {{highlight|'''"left arrow key"'''}} to seek backward.

=== Change playback speed ===
 {{Board$}} gst-play-1.0 {{av_ref_file}}
Press {{highlight|'''"+" key'''}} to increase rate and {{highlight|'''"-" key'''}} to decreased it.

=== HTTP streaming ===
{{Info|An internet connection is required, for example by plugging an Ethernet cable on
* the [[STM32MP157xSTM32MP157C-EV1 - hardware description#MB1262-CN3|STM32MP157xSTM32MP157C-EV1 Evaluation board CN3 Ethernet connector]]
* the [[STM32MP157x-DKxSTM32MP157X-DKX - hardware_description#MB1272-CN8|STM32MP157x-DKxSTM32MP157X-DKX Discovery kit CN8 Ethernet connector]]
}}{{UpdateNeededForNewBoard|Point to the Ethernet connector (if any) of the new board}}
{{InternalInfo|
When connected on ST internal network, http requests must be redirected to appgw.gnb.st.com ST proxy using command:
 {{Board$}} export http_proxy{{=}}<nowiki>http://</nowiki><login>:<pwd>@10.129.92.5:8080
See [[How to avoid proxy issues]] article for more details.

Then you can play the video:
}}

 {{Board$}} gst-play-1.0 {{av_ref_http}}

=== Audio/video playback on HDMI TV ===
{{Info|Plug first HDMI TV cable as described in [[How to display on HDMI]] article}}
{{UpdateNeededForNewBoard|Point to the HDMI connector (if any) of the new board}}

Switch audio output on HDMI:
 {{Board$}} pacmd set-card-profile 0 output:hdmi-stereo

Than play the video:
 {{Board$}} gst-play-1.0 {{av_ref_file}}

=== Audio/video playback in background ===
Option {{highlight|'''--no-interactive'''}} must be set in order to be able to play in background:
 {{Board$}} gst-play-1.0 {{av_ref_file}} {{highlight|'''--no-interactive'''}} &
 [1] 14998
 root@stm32mp1:~# Now playing /av_h264_main_640x480_30fps_1000kbps_aac-lc_192kbps.mp4

Then to stop playback:
 {{Board$}} killall gst-play-1.0

or 
 {{Board$}} fg<CTRL+C>

<noinclude>

{{PublicationRequestId| 7660 | 2018-06-11 | BrunoB}}
[[Category:GStreamer]]</noinclude>
Line 63: Line 63:
 
{{Info|Don't have ''{{av_ref_file}}'' ? Follow instructions in [[Template:Av_ref_file#Download_this_file|this article]].}}
 
{{Info|Don't have ''{{av_ref_file}}'' ? Follow instructions in [[Template:Av_ref_file#Download_this_file|this article]].}}
 
{{Info|To hear audio track, depending on the considered board, an audio headset must be plugged on
 
{{Info|To hear audio track, depending on the considered board, an audio headset must be plugged on
* the [[STM32MP157C-EV1 - hardware description#MB1262-CN5|STM32MP157C-EV1 Evaluation board CN5 jack connector]]
+
* the [[STM32MP157x-EV1 - hardware description#MB1262-CN5|STM32MP157x-EV1 Evaluation board CN5 jack connector]]
* the [[STM32MP157X-DKX - hardware description#MB1272-CN10|STM32MP157X-DKX Discovery kit CN10 jack connector]]
+
* the [[STM32MP157x-DKx - hardware description#MB1272-CN10|STM32MP157x-DKx Discovery kit CN10 jack connector]]
 
}}{{UpdateNeededForNewBoard|Point to the jack connector (if any) of the new board}}
 
}}{{UpdateNeededForNewBoard|Point to the jack connector (if any) of the new board}}
   
Line 95: Line 95:
 
=== HTTP streaming ===
 
=== HTTP streaming ===
 
{{Info|An internet connection is required, for example by plugging an Ethernet cable on
 
{{Info|An internet connection is required, for example by plugging an Ethernet cable on
* the [[STM32MP157C-EV1 - hardware description#MB1262-CN3|STM32MP157C-EV1 Evaluation board CN3 Ethernet connector]]
+
* the [[STM32MP157x-EV1 - hardware description#MB1262-CN3|STM32MP157x-EV1 Evaluation board CN3 Ethernet connector]]
* the [[STM32MP157X-DKX - hardware_description#MB1272-CN8|STM32MP157X-DKX Discovery kit CN8 Ethernet connector]]
+
* the [[STM32MP157x-DKx - hardware_description#MB1272-CN8|STM32MP157x-DKx Discovery kit CN8 Ethernet connector]]
 
}}{{UpdateNeededForNewBoard|Point to the Ethernet connector (if any) of the new board}}
 
}}{{UpdateNeededForNewBoard|Point to the Ethernet connector (if any) of the new board}}
 
{{InternalInfo|
 
{{InternalInfo|