[Gambas-user] "Cannot set status" by playing a VIDEO file with MediaView

Benoît Minisini benoit.minisini at gambas-basic.org
Tue Jan 9 21:29:48 CET 2024


Le 09/01/2024 à 18:23, Claus Dietrich a écrit :
> On 07.01.24 at 17:56 vuott wrote via User:
> /> wanting to run a VIDEO file with MediaView (gb.media.form Component), 
> the error is raised:/
> /> « Cannot set status »./
> 
> On 08.01.24 at 15:48 Claus wrotevia User:
>  > Same here on Mint 21.2 Mate with Gambas 3.18.4.
> 
> I withdraw my above post. Meanwhile I found that I didn't use the 
> MediaView class as probably
> intended and now it works far better. However, there is still an issue 
> left.
> 
> Here my reference snippet with according comments (Mint 21.2 Mate and 
> Gambas Master).
> 
> Private mv As MediaView
> 
> Public Sub Form_Open()
> 
> Me.W = 500
> Me.H = 320
> Me.Arrangement = Arrange.Fill
> 
> mv = New MediaView(Me)
> 
> mv.Expand = True
> 
> 'Example 1 - causing error "Cannot set status"
> mv.URL = 
> "https://file-examples.com/wp-content/storage/2018/04/file_example_AVI_640_800kB.avi"
> 
> 'Example 2 - works
> 'mv.url = "'mv.URL = 
> "https://files.edge.network/misc/avi/file_example_AVI_640_800kB.avi"
> 
> 'Example 3 - works but playing cannot by stopped
> 'mv.URL = 
> "https://filesamples.com/samples/video/mkv/sample_960x400_ocean_with_audio.mkv"
> 
> Example 4 - works
> 'mv.URL = "/home/" & System.User.Name & 
> "/Videos/sample_960x400_ocean_with_audio.mkv"
> 
> End
> 
> Public Sub Form_Close()
> 
> mv.Stop
> 
> End
> 
> When I started the video Example 1 directly with gstreamer ....
> 
> gst-launch-1.0 playbin 
> uri=https://file-examples.com/wp-content/storage/2018/04/file_example_AVI_640_800kB.avi
> 
> I got the error message: Missing decoder: text/html (text/html)
> 
> It seems that this problem is rather caused by the web page. The same 
> video under the URL of Example 2 works fine.
> 
> However, does somebody have an explanation why I couldn't stop the video 
> of example 3 ? The same video as local file ((Example 4) doesn't have 
> this problem .
> 
> Best regards
> Claus
> 

In the last commit, I modified the MediaView control so that it displays 
the error messages returned by GStreamer, like 'gst-launch'.

I get the same result as you for these videos, except example 3, where 
stopping the stream works, even if it is not immediate.

I often don't have the position of the video for network streams.

I noticed too that now the aspect ratio of the video is not kept anymore 
by GStreamer. It was in the past. I'd like to know what should be done 
to force the GStreamer "playbin" to keep the video aspect ratio.

I have read the source code of 'gst-launcher' too, and noticed that it 
runs the GStreamer pipeline in a more complex way than I do with the 
MediaPipeline Gambas class. I said "complex"? I should say "horrible"...

Maybe in the future I will mimic as much as possible what 'gst-launcher' 
does, but I usually like to understand why things should be done the way 
they are done.

Regards,

-- 
Benoît Minisini.



More information about the User mailing list