Go Back   PreCentral Forums > webOS Software and Chat > web OS Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08/06/2009, 02:49 AM   #1 (permalink)
Member
 
Join Date: Jul 2009
Posts: 21
Thanks: 2
Thanked 41 Times in 5 Posts
Default Video Recording (For Real, no GUI)

Guys, not sure if this has been done yet: I actually did get mp4 recording on the Pre via command line this evening. No GUI and the file is playable by VLC player (not Quicktime, possibly because I just killed the gstream with ctrl-x) but maybe someone can help me with that part.



At your rooted command line

(make sure FS is rw)
mount -o remount,rw /
gst-launch camsrc ! palmvideoencoder ! filesink location=/media/internal/downloads/foo.mp4
mount -o remount,ro /

Like I said, no GUI but other than that, not bad, right? Frame rate seemed pretty decent too. Note: there is no sound recording.


(edited to add attachment - brief vid with me making a ******** face)
(edit 2: sound)
Attached Files
File Type: zip foo.zip (635.5 KB, 1023 views) Email Attachment
cpcrook is offline   Reply With Quote
Old 08/06/2009, 03:05 AM   #2 (permalink)
Member
 
Colonel Kernel's Avatar
 
Join Date: Apr 2009
Location: Boston, MA
Posts: 398
Thanks: 83
Thanked 58 Times in 27 Posts
Default

I tried to play the video with VLC, but it seems to be of zero length. I just installed VLC on this machine (Win XP 32bit).

Great to hear someone working on this, tho.
Colonel Kernel is offline   Reply With Quote
Thanked By:
Old 08/06/2009, 03:08 AM   #3 (permalink)
Member
 
Join Date: Jul 2009
Posts: 21
Thanks: 2
Thanked 41 Times in 5 Posts
Default

The file is definitely not well formed, but it claims its H.264 encoded. Here's the commandline output:


root@castle:/media/internal# gst-launch camsrc ! palmvideoencoder ! filesink location=/media/internal/downl
oads/foo2.mp4
stop: (01011/78784179) Job not changed: camd
(01011/124468994) camd: goal changed
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
proposed caps: video/x-raw-yuv
Initially, Got the following OUTPUT values from the encoder:
pPortDef->format.video.nBitrate = 64000
pPortDef->format.video.eCompressionFormat = 7
Setting video encoding to H.264
===> After settings, we have the following OUTPUT values from the encoder:
pPortDef->format.video.nBitrate = 64000
pPortDef->format.video.eCompressionFormat = 7
Caught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 17251647949 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
--------------------> OMX_FreeHandle succeeded
^X[1] + Stopped gst-launch camsrc ! palmvideoencoder ! filesink location=/media/internal/downloads/foo2.mp4


edit: gst-inspect will give you a list of possible sources, but most are for decoding/demuxing.
edit2: The Videos app will not recognize anything recorded, at least as long as I keep ending recordings using ctrl-c or ctrl-z to kill
cpcrook is offline   Reply With Quote
Thanked By:
Old 08/06/2009, 04:10 AM   #4 (permalink)
Member
 
Join Date: Jul 2009
Posts: 21
Thanks: 2
Thanked 41 Times in 5 Posts
Default

Just digging around more on gstreamer...if/when we get a GUI slapped on it, there seems to be potential for live streaming video conferencing - the XO laptop can do it...laptop.org has a page about the XO laptop using Gstreamer (i can't link because of number of posts...)
cpcrook is offline   Reply With Quote
Old 08/06/2009, 04:21 AM   #5 (permalink)
Member
 
mrloserpunk's Avatar
 
Join Date: Jul 2008
Location: Syracuse
Posts: 1,799
Thanks: 396
Thanked 235 Times in 170 Posts
Default

Awe *snap!
__________________
"When there is no more room in hell, the dead will walk the earth"
mrloserpunk is online now   Reply With Quote
Old 08/06/2009, 04:44 AM   #6 (permalink)
Member
 
scizzy's Avatar
 
Join Date: May 2009
Posts: 203
Thanks: 93
Thanked 61 Times in 21 Posts
Default

I can't even get it to play... in vlc...


Lets keep digging shall we...
scizzy is offline   Reply With Quote
Old 08/06/2009, 07:43 AM   #7 (permalink)
Forum Moderator
 
sarah peterman's Avatar
 
Join Date: Jun 2009
Location: York, PA
Posts: 253
Thanks: 32
Thanked 143 Times in 54 Posts
Default

Oh wow, good job. I got it working. There is no sound recorded, but that could just be my comp... Thank you, this is a awesome find.

Also, vlc doesn't play it correctly, use another video player.
__________________
aka lunareclipse
You can find me here:

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.

Last edited by sarah peterman; 08/06/2009 at 09:19 AM.
sarah peterman is offline   Reply With Quote
Old 08/06/2009, 10:36 AM   #8 (permalink)
Member
 
Kyusaku's Avatar
 
Join Date: Apr 2007
Posts: 1,084
Thanks: 62
Thanked 134 Times in 91 Posts
Default

Grats, amazing work!
Kyusaku is offline   Reply With Quote
Old 08/06/2009, 10:37 AM   #9 (permalink)
Member
 
Join Date: Jul 2009
Posts: 21
Thanks: 2
Thanked 41 Times in 5 Posts
Default

I guess the variability of what will play the file has to do with codec packs and versioning.

I'm currently focusing on /usr/lib/luna/luna-media/palmInitMedia.js to see if I can't create a video pipe and capture method, whether it be creating one from scratch or simply routing the _preview used for the still camera preview to the filesystem.

EDIT: Points of interest around line 800
cpcrook is offline   Reply With Quote
Old 08/06/2009, 11:30 AM   #10 (permalink)
Member
 
Join Date: Jul 2009
Posts: 21
Thanks: 2
Thanked 41 Times in 5 Posts
Default

Just a little more info:

The camera module on the Pre is the VX6852. More info & data sheets: STMicroelectronics | QXGA EDOF camera module - VX6852

Palm appears to have implemented the standard video4linux2 to interface with the camera.
cpcrook is offline   Reply With Quote
Old 08/06/2009, 11:54 AM   #11 (permalink)
Member
 
Join Date: Apr 2004
Posts: 131
Thanks: 4
Thanked 38 Times in 17 Posts
Default

Quote:
Originally Posted by cpcrook View Post
Just a little more info:

The camera module on the Pre is the VX6852. More info & data sheets: STMicroelectronics | QXGA EDOF camera module - VX6852

Palm appears to have implemented the standard video4linux2 to interface with the camera.

" The product can output raw bayer 3 Mpixel images at up to 20 fps"

Interesting. Looks like it can potentially record full sensor resolution (beyond HiDef) at up to 20fps. If the CPU can handle the bandwidth that is
zonyl is offline   Reply With Quote
Old 08/06/2009, 12:00 PM   #12 (permalink)
Member
 
Join Date: Jul 2009
Posts: 21
Thanks: 2
Thanked 41 Times in 5 Posts
Default

In the file of interest I mentioned Palm has their prefs set for the still camera preview stream as 30fps but at screen resolution (320x480) and it certainly appears to be that way.

I guess we could modify the preview stream in that mediainit file to preview in full resolution and a lower frame rate which would be interesting.
cpcrook is offline   Reply With Quote
Old 08/06/2009, 12:12 PM   #13 (permalink)
Member
 
Join Date: Jun 2009
Posts: 425
Thanks: 15
Thanked 234 Times in 72 Posts
Default

Good stuff. From what I read, Palm is working on a video camera app with a third party developer, but your experiments are very interesting.
Blubble is online now   Reply With Quote
Thanked By:
Old 08/06/2009, 12:17 PM   #14 (permalink)
Member
 
Join Date: Jul 2009
Posts: 21
Thanks: 2
Thanked 41 Times in 5 Posts
Default

I'm not so much concerned with the video recording as much as learning a bit more about how all of this works in the first place. Plus, the lower level we get, the more possibilities for cool apps like video conferencing and augmented reality...
cpcrook is offline   Reply With Quote
Old 08/06/2009, 12:19 PM   #15 (permalink)
Member
 
Join Date: Jun 2009
Posts: 425
Thanks: 15
Thanked 234 Times in 72 Posts
Default

I'm with you. I can't wait for Palm to release a real SDK. This javascript stuff is passable, but I'd really rather be able to at least use Java or better yet, C++ and get access to much more of the capabilities of the hardware.
Blubble is online now   Reply With Quote
Old 08/06/2009, 12:29 PM   #16 (permalink)
Member
 
Join Date: Apr 2004
Posts: 131
Thanks: 4
Thanked 38 Times in 17 Posts
Default

I am able to record video from the UI . I have a thttp server running on the phone and created bookmarks to two links (VidRec) and (VidStop) I can even remotely record now hitting my webserver from the EvDO IP.

/localhost/cgi-bin/vidrec.sh:
Code:
#!/bin/sh
echo "HTTP/1.1 302 found"
echo "Location: http://localhost:8888/palm.html"
echo "Content-Type: text/html"
echo ""

#Turn on the flash!
cd /sys/class/i2c-adapter/i2c-2/2-0033
echo -n 1 >avin
echo -n 100mA >torch_current
echo -n torch >mode

FILE="`date +%m`_`date +%d`_`date +%y`_`date +%H`_`date +%M`_`date +%S`.mp4"
gst-launch camsrc ! palmvideoencoder ! filesink location=/media/internal/downloads/$FILE &
/localhost/cgi-bin/vidstop.sh
Code:
#!/bin/sh
echo "HTTP/1.1 302 found"
echo "Location: http://localhost:8888/palm.html"
echo "Content-Type: text/html"
echo ""

#Turn off flash
cd /sys/class/i2c-adapter/i2c-2/2-0033
echo -n shutdown >mode
echo -n 0mA >torch_current
echo -n 0 >avin

killall -HUP gst-launch-0.10
** Note if you are having troubles with errors starting recording you need to make sure you have initialized the camera first by running the Camera app at least once during the session. ***

CPCrook: Ill have to play with those settings as well to see if we can boost the resolution.

I think audio can be had by including the Alsa mic on the pipeline. Im not familiar with gstreamer enough to know how to do this exaclty yet.

File plays fine on Mplayer but not recognized by the internal video player on the Pre.
Code:
Playing PreVideoTest.mp4.
H264-ES file format detected.
FPS seems to be: 30.000000
xscreensaver_disable: Could not find XScreenSaver window.
GNOME screensaver disabled
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Audio: no sound
Starting playback...
VDec: vo config request - 480 x 320 (preferred colorspace: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 480x320 => 480x320 Planar YV12

Last edited by zonyl; 08/06/2009 at 01:49 PM.
zonyl is offline   Reply With Quote
Thanked By 2:
Old 08/06/2009, 12:46 PM   #17 (permalink)
Member
 
fain's Avatar
 
Join Date: Jun 2009
Location: Lexington KY
Posts: 544
Thanks: 38
Thanked 90 Times in 58 Posts
Default

Awesome!!! The output played fine in totem on ubuntu jaunty.
fain is online now   Reply With Quote
Old 08/06/2009, 01:08 PM   #18 (permalink)
Member
 
Join Date: Apr 2004
Posts: 131
Thanks: 4
Thanked 38 Times in 17 Posts
Default

Hm.. The flash seems to get turned off when the camera starts recording. Looking into that as well.

Last edited by zonyl; 08/06/2009 at 01:34 PM.
zonyl is offline   Reply With Quote
Old 08/06/2009, 01:21 PM   #19 (permalink)
Member
 
Join Date: Jul 2009
Posts: 21
Thanks: 2
Thanked 41 Times in 5 Posts
Default

Looks great! I'm looking into modifying the camera app so it only records video, not still...

edit: theres a new "VideoRecording" section on the webos-internals wiki if you'd like to detail what you've done.
cpcrook is offline   Reply With Quote
Old 08/06/2009, 02:36 PM   #20 (permalink)
Member
 
TheMarco's Avatar
 
Join Date: Jun 2009
Location: Sunnyvale CA
Posts: 534
Thanks: 18
Thanked 103 Times in 46 Posts
Default

Wicked man. This looks promising indeed!
__________________
I know Javascript. And CSS, and design. Check out my
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
. Beauty AND brains!


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
, the real dot matrix message scroller!
TheMarco is offline   Reply With Quote
Thanked By 2:
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 02:16 PM.

Creating smartphone communities
Android Central - Android reviews, news and forums Crackberry - Blackberry news, reviews and community TiPb - iPhone news, accessory reviews & forums
Pre Central - Palm Pre Review, News and Community Treo Central - Treo & Centro News and Forums WMExperts - Windows Mobile Reviews & News

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0