WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: multimedia video and audio playback on raspberry pi (web streams or local)  (Read 4407 times)

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 792
hello,

incase it is helpful to raspberry pi users with piCore.  (pi zero boards upwards)

you should be able to have full multimedia video and audio playback (like youtube) as web streams using the "ffplay" tool from within "ffmpeg".

here are commands that possibly get the player working.

1) load the "ffmpeg" tool.....then load the extra deps "freetype.tcz" and "fontconfig.tcz" and "sdl" and "lame"

2) at the terminal prompt type.......   (example below)

SDL_AUDIODRIVER="alsa" AUDIODEV="hw:1,0" ffplay https://vprbbc.streamguy
s1.com/vprbbc24.mp3

(for streaming radio station)

or for a streaming video with sound type........

SDL_AUDIODRIVER="alsa" AUDIODEV="hw:1,0" ffplay
"https://redirector.googlevideo.com/videoplayback?expire=1604601751&ei=N_OjX8rZINmI2LYP85OJiAk&ip=104.153.82.35&id=o-ALqMGyqRBSfdFyKectRjZq6olJ72zpAkDwY4FKgpOB_c&itag=17&source=youtube&requiressl=yes&mh=Y_&mm=31%2C29&mn=sn-p5qs7ner%2Csn-p5qlsnsk&ms=au%2Crdu&mv=m&mvi=6&pl=22&initcwndbps=2635000&vprv=1&mime=video%2F3gpp&gir=yes&clen=1040013&dur=119.768&lmt=1601120012639257&mt=1604580042&fvip=6&c=MWEB&txp=5532434&sparams=expire%2Cei%2Cip%2Cid%2Citag%2Csource%2Crequiressl%2Cvprv%2Cmime%2Cgir%2Cclen%2Cdur%2Clmt&sig=AOq0QJ8wRgIhAIxbGPJXP82RHavrWnSYHr2bLsF6OcTx10dV6R0FjF4SAiEApeqKbhWwO9uvPbqDkNKoDw6WQsnv_cLiMT7-2WW2lOw%3D&lsparams=mh%2Cmm%2Cmn%2Cms%2Cmv%2Cmvi%2Cpl%2Cinitcwndbps&lsig=AG3C_xAwRQIgUojr0Gh23-h9P1UlR3PG5Bc28edEprqiFRjSPt43bUYCIQCQDS319D4hSjAWZQBUdMzwktr0UvWLgKIog3H_jLihzQ%3D%3D&ratebypass=yes&utmg=ytap1_64R2MYUt394&title=David_Attenborough_A_Life_on_Our_Planet__Official_Trailer__Netflix.3gp"

where the streaming video link is in quotes and preceded by a space.

The free streaming youtube video links come from reflector sites such as genyt.net.
(generate download links)

For local video's or audio files it's just the path to the file.

thx

v
« Last Edit: November 05, 2020, 09:33:57 AM by Rich »

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 792
Re: multimedia video and audio playback on raspberry pi (web streams or local)
« Reply #1 on: November 05, 2020, 02:55:26 PM »
users may realize, they need a new fifty cents USB soundcard off of ebay.
alternatively they may use hdmi sound out, which should work

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 792
Re: multimedia video and audio playback on raspberry pi (web streams or local)
« Reply #2 on: November 05, 2020, 05:23:17 PM »
users may not need any of the endevours in this OP....

they may only need to use at the prompt

ffplay <the video url link>..............or..............<the audio radio stream link>

(or local paths to local videos or songs)

Thx

Vin

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1230
Re: multimedia video and audio playback on raspberry pi (web streams or local)
« Reply #3 on: November 05, 2020, 07:57:33 PM »
users may realize, they need a new fifty cents USB soundcard off of ebay.
alternatively they may use hdmi sound out, which should work

Are you saying that you cannot get sound from the headphone jack?

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 792
Re: multimedia video and audio playback on raspberry pi (web streams or local)
« Reply #4 on: November 05, 2020, 10:53:35 PM »
paul,

the post is referring to boards from the pi zero upwards...i don't believe the pi zero has a headphone jack....but usb soundcard can be used or hdmi or analogue audio from the gpio pins instead.

all other pi boards can use the headphone out jack (if it has it) or hdmi or usb souncard or the gpio pins....

v
« Last Edit: November 05, 2020, 10:56:27 PM by vinceASPECT »

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 792
Re: multimedia video and audio playback on raspberry pi (web streams or local)
« Reply #5 on: November 10, 2020, 09:08:44 AM »
hello,

....there are some extra good arguments for using with the "ffplay" multimedia player when playing live internet streams of radio or mp3 songs....... or of youtube videos etc....

The arguments make cpu usage economical etc.

Users can search youtube videos on a text only browser such as "Links" browser on piCORE armv6 for pi zero etc.......or any pi computer.
genyt.net  (search any vids of interest and "generate download links")

tcl$.........ffplay -fast -nodisp -cpuflags -sse+mmx+3dnow -volume 20 "https://vprbbc.streamguy/s1.com/vprbbc24.mp3"
(Live radio playing)

tcl$.........ffplay -fast -cpuflags -sse+mmx+3dnow -volume 20
"https://SOME VIDEO.mp4"
(Live youtube video)

(where there is a space preceding the link in quotes.....above)

The -cpuflags are whatever your computer chip supports.....
e.g. sse2 mmx armv6 armv7......etc etc.
Putting........ "-cpuflags 0".....will clear all the cpu flags you previously set.
(you can list your cpu features using a flag)

The "-volume" argument is how you can set the volume at start of play (1 to 100)
-volume 20  (example)

......you can SEEK in any internet stream or local song by simply pressing your left or right arrow keys or page-up,page-down .....OR..... right clicking the mouse anywhere in the video window width ....(where 30 percent into the window width is a third of the way through the video tv show.....etc)
 
(this "clicking seek feature" works whenever the  "-nodisp" flag is omitted.....which means it's a feature mainly for streaming videos.)

-nodisp............ (means no display....and is used for live audio--only streams like radio)
-alwaysontop ....(keeps your video window ontop)
-noborder......... (can hide all video borders)
-left 30..............(set the x position of the left side of video window)
-top................. (set the y position of top of the video window)--centered window is default
-fs.....................(start the video in fullscreen)
-x 60.................(force displayed video width)
-y......................(force displayed height of video)

P key for pause. .........F  key for fullscreen.........q or ESC......quit the player.
9 key is volume up.......0 key is volume down.
« Last Edit: November 24, 2020, 11:21:01 AM by Rich »

Offline cast-fish

  • Hero Member
  • *****
  • Posts: 1000
  • hi there

Offline vinceASPECT

  • Hero Member
  • *****
  • Posts: 792
Re: multimedia video and audio playback on raspberry pi (web streams or local)
« Reply #7 on: February 06, 2022, 10:10:31 PM »
The command that likely makes multimedia video etc work on Raspberry Pi's is below

FOR WEB AUDIO STREAMS ...........................................below

tcl$.........ffplay -fast -nodisp "https://vprbbc.streamguy/s1.com/vprbbc24.mp3"

-------------------------------------------------------------------------------------------------------------------------------------
FOR WEB VIDEO and AUDIO combined stream ..............below

tcl$.........ffplay -fast "https://SOME VIDEO.mp4"
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------
---------------------------------------------------------------------------------

Tinycore 64 bit people AND OR  32 bit people may need what's below on INTEL or ARM Raspberry pi machines............for web radio audio

$tcl..........SDL_AUDIODRIVER="alsa" ffplay -fast -nodisp "https://vprbbc.streamguys1.com/vprbbc24.mp3"

and what's below for web streaming Video+audio combined...........

$tcl..........SDL_AUDIODRIVER="alsa" ffplay -fast "https:/SOME WEB STREAM VIDEO.mp4"

YOU MAY ALSO NEED the "-i"  flag...........e.g  ffplay -i -fast "some stream"

You can see tbe whole POST STORY above to Learn how to multimedia on Raspbery Pi's etc and mess around to improve things with FLAGS for the FFPLAY media player

Thx
C.
« Last Edit: February 06, 2022, 10:14:24 PM by Rich »