Hi!
I am trying to extract a frame from a video file and then display in an imageview. I am not very experienced in using java objects and am trying this code:
I get a 'Class Not Found' exception at the line indicated.
Can I have some help with the correct code for extracting a video frame using B4J.
Thank you!
I am trying to extract a frame from a video file and then display in an imageview. I am not very experienced in using java objects and am trying this code:
B4X:
Dim fc As
fc.Initialize
fc.InitialDirectory = File.DirApp
fc.SetExtensionFilter("Video", Array As String("*.mp4"))
fc.Title = "Select a Video File"
fc.InitialFileName = mediaFile
fc.InitialDirectory = File.DirApp
VideoFile = fc.ShowOpen(MainForm)
If VideoFile.Length = 0 Then Return
Dim fileO As JavaObject
fileO.InitializeNewInstance("java.io.File", Array As Object(VideoFile))
VideoFile = fileO.RunMethod("getName", Null)
VideoFolder = fileO.RunMethod("getPath", Null)
VideoFolder = mediaFolder.Replace(VideoFile, "")
'get a frame and display
Dim jo_1, mmr As JavaObject
Dim bmp As Image
'class not found exception on the following line:
mmr = jo_1.InitializeNewInstance("javafx.scene.media.MediaMetadataRetriever", Array As Object())
mmr.RunMethod("setDataSource", Array As Object(VideFolder, VideoFile))
bmp=mmr.RunMethod("getFrameAtTime", Array As Object(1))
Can I have some help with the correct code for extracting a video frame using B4J.
Thank you!