How to play a video file in Gambas? [SOLVED]
Posted
#1
(In Topic #1011)
Regular

But I get error "Cannot set status"
Posted
Regular

JumpyVB said
Code (gambas)
myPlayer.URL = "/home/user/Videos/home_video_from_android_phone.mp4"
with:
Code (gambas)
- myPlayer.URL = Media.URL("/home/user/Videos/home_video_from_android_phone.mp4")
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

Is there a way to play the video rotated 90 degrees?
Posted
Guru

Is there a way to play the video rotated 90 degrees?
You could rotate the video before playing it. Have a look here.
Posted
Regular

Prerotating is not an option. I am making a simple video viewer to quickly view and delete unwanted home videos. Celluloid will play the video with the correct orientation. Also the orientation metadata is there - I checked with exiftool. Just need to figure out how to use gb.media correctly. The whole gstreamer tool chain seems very capable but also daunting.cogier said
You could rotate the video before playing it. Have a look here.
Posted
Regular

At the moment the only way that works for me, to rotate a video, is to use the external resources of the GStreamer library with "Extern".JumpyVB said
Is there a way to play the video rotated 90 degrees?
Check out this page, that I wrote, of the Gambas italian programmers Forum Wiki:
https://www.gambas-it.org/wiki/index.php/Riprodurre_un_video_ruotato_in_tempo_reale_con_la_funzione_esterna_%27%27gst_parse_launch(_)%27%27_di_GStreamer
Unfortunately I was unable to rotate a video using the resources of gb.media Component.
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

This is my test code by using "MediaPipeline" and "MediaControl" Classes of gb.media:
Code (gambas)
- vertical_flip, upper_left_diagonal, upper_right_diagonal, automatic
- pl = New MediaPipeline
- src["location"] = "/path/of/videofile"
- ' Sets necessary MediaControl (GStreamer plugins):
- flp["method"] = clockwise
- ' Connects the set MediaControls:
- con.LinkTo(flp)
- flp.LinkTo(snk)
- snk.SetWindow(DrawingArea1)
- pl.Play()
- Wait 0.01
- ' The elapsed time since the video started running:
- Wait 0.1
- pl.Close
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

Code (gambas)
- vertical_flip, upper_left_diagonal, upper_right_diagonal, automatic
- videofile = "/path/of/videofile"
- pl = New MediaPipeline
- vsrc["location"] = videofile
- ' Sets necessary MediaControl (GStreamer plugins):
- vflp["method"] = clockwise
- ' Connects the set MediaControls:
- vsrc.LinkTo(vbin)
- vbin.LinkLaterTo(vcon)
- vcon.LinkTo(vflp)
- vflp.LinkTo(vsnk)
- asrc["location"] = videofile
- asrc.LinkTo(abin)
- abin.LinkLaterTo(acon)
- acon.LinkTo(ares)
- ares.LinkTo(asnk)
- vsnk.SetWindow(DrawingArea1)
- pl.Play()
- Wait 0.01
- ' The elapsed time since the video started running:
- Wait 0.1
- pl.Close
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Regular

Posted
Regular

Posted
Guru

Maybe you can install missing codecs. Like h264 etc (whatever format the unplayable files are)
Or upgrade your mint with the mintupdate tool.
1 guest and 0 members have just viewed this.


