B4A Library RSVideoRecord Library!!!

Hello everyone,

Here is a new library where you can record videos using a panel and not using the standard camera.
The important thing about this library is that you respect the order of used methods!

I had trouble working with the screen quality and the panel gave me a "green-like overlaying- corrupt video" but the output worked when i used profile. However when working with setVideoSize, it worked, but gave me a bad quality video.

A sample is included that shows the Videorecorder and saves it.
Please try it out and try to improve it and see what suits.

Tomas
 

Attachments

  • RSVideoRecord.zip
    9.4 KB · Views: 1,628
Last edited:

manios

Active Member
Licensed User
Longtime User
:signOops:

pls take a look at the code. It seems to miss some parts, i.e. the Sub "btnTakePicture". Also line 9 says "Dim record As VideoRecord" it should be "Dim record As RSVideoRecord"
Also get nullpointer exception when using "Prepare", "Start" und "Stop"
 

jota

Active Member
Licensed User
Longtime User
in me HTC Wildfire only save records sound. Thanks for the library
 

jota

Active Member
Licensed User
Longtime User
Using the example that came with the library, it generates a file "watch.3gp" that played on the same device there is only sound.
 

jota

Active Member
Licensed User
Longtime User
thanks for the help but the link does not show any effective solution and the space on my phone is 1.5Gb, I think enough. thanks again
 

vb1992

Well-Known Member
Licensed User
Longtime User
How does this one work for you:


VideoRecordApp in the AUDIO LIBRARY

VideoRecordApp lets you use the default video recorder application to record video.
After initializing the object you should call Record to start recording.
The RecordComplete event will be raised when record completes.
Example:

B4X:
Sub Process_Globals
    Dim audioRecorder As AudioRecordApp
    Dim videoRecorder As VideoRecordApp
End Sub

Sub Globals
    Dim vv As VideoView
End Sub

Sub Activity_Create(FirstTime As Boolean)
   If FirstTime Then
           audioRecorder.Initialize("audioRecorder")
        videoRecorder.Initialize("videoRecorder")
    End If
    vv.Initialize("vv")
    Activity.AddView(vv, 0, 0, 100%x, 100%y)
    Activity.AddMenuItem("Record Video", "RecordVideo")
    Activity.AddMenuItem("Record Audio", "RecordAudio")
    ToastMessageShow("Press on Menu button...", True)
End Sub

Sub RecordVideo_Click
    videoRecorder.Record(File.DirRootExternal, "1.mp4")
End Sub
Sub RecordAudio_Click
    audioRecorder.Record(File.DirRootExternal, "1.3gpp")
End Sub
Sub videoRecorder_RecordComplete (Success As Boolean)
    Log(Success)
    If Success Then
        vv.LoadVideo(File.DirRootExternal, "1.mp4")
        vv.Play
    End If
End Sub
Sub audioRecorder_RecordComplete (Success As Boolean)
    Log(Success)
    If Success Then
        vv.LoadVideo(File.DirRootExternal, "1.3gpp")
        vv.Play
    End If
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub 
Events:
RecordComplete (Success As Boolean)
Members:

  Initialize (EventName As String)

  Record (Dir As String, FileName As String)

Members description:
  Initialize (EventName As String)

Initializes the object and sets the sub that will handle the event.
 Record (Dir As String, FileName As String)

Calls the recording application.
Dir and FileName set the output file location.
 

jota

Active Member
Licensed User
Longtime User
The example works fine with the library "Audio". But with the example that came with the library "RSVideoRecord" still does not record video, if I change the resolution of setScreenSize (640.480) to (320.240) achieving a green background with stripes. thanks
 

mading1309

Member
Licensed User
Longtime User
Update of Library?

Hi,

First thanks for the library. I am not expert enough make any changes to a wrapper-library

I need to record a live video with overlay information.
The library doesn't start video recording.

Init and prepare command seems to work. Start recording results in a general error message
As a result, stop recording doesn't work too
Any comments what I am doing wrong. I tried to use Version 2.1 (Experia 8) and Version 2.3.7 (Sonic)

Is there any other idea recording a video and show the live video in a panel for example?

Looking forward some replies
mading
 

Highwinder

Active Member
Licensed User
Longtime User
Fantastic!

XverhelstX,

From what it looks like, this appears to be a library that allows my app to make video recordings of itself as long as I'm capturing a panel. Can it also add audio from the microphone to the recording as well?

Thanks!
 

mattdarnell

Member
Licensed User
Longtime User
Here is the start/demo of what a video overlay example could look like that is working.

As soon as I press the start button, after initialize, the video freezes. The 'speed' window continues to change, but the video does not. If I press the stop button I get a java exception.

I am using a T-Mo S3.

-Matt
 

jscoulter

Member
Licensed User
Longtime User
HI.
I tried this, it works, BUT, the overlay is not recorded with the file.
I had already drawn something on the panel myself in an earlier test I had done. But it seems that using B4A at least, it is not possible to record he overlay? or am I wrong...hoping I am :)

Jeremy
 

vb1992

Well-Known Member
Licensed User
Longtime User
You might be able to do screen captures
of the video and overlay

http://www.b4x.com/forum/basic4android-updates-questions/16440-scrren-capture.html#post93664

I would first see if you can get a screen capture of the two
and then store the images then merge them somehow into a video
or animatedGIF

extra links for this:
http://www.b4x.com/forum/basic4andr...-capture-screen-shot-videoview.html#post89151

http://www.b4x.com/forum/additional...66-library-animatedgifencoder.html#post112809


http://stackoverflow.com/questions/9075042/video-creation-from-series-of-images
 
Last edited:

WhataJeff

Member
Licensed User
Longtime User
rsvideorecord works great until I accidentally hit one of the volume buttons. It locks the whole phone up.

Anyone see this?

while video is playing hit a volume button. You will see the volume bar and will not be able to get out of it. weird.

Any way to work around this?

J
 

androh

Member
Licensed User
Longtime User
Hi,
First, thanks for this great lib.
I want to stream video to internet. Like this Create and share live video
But in this lib, I saw only "setOutputFile". There is no outputstream.
Is there any other way for solve this problem?
 

WhataJeff

Member
Licensed User
Longtime User
Ok got around the volume issue. I use an activity_keypress to disable the volume buttons while recording.

Another thing I noticed is that there is a 10 minute limit on video recording? I have a need to take video up to 30 minutes. The .mp4 video format does a nice job of compression so file size is reasonable.

Anyone else out there using RSVideo Record?

Edit:

I guess I can live with the 10 minute restriction. I can alway force a shutdown like

B4X:
'Limit the recording to 9 minutes 50 seconds (10 minute restriction)
   If RecordElapsedTime > 590000 Then
      mnuStop_Click
      mnuRelease_Click
      Activity.Finish
   End If
 
Last edited:
Top