Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 23 Nov 2014, 08:25
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
ffmpeg record your desktop but how to stop? [Solved]
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Wed 29 Dec 2010, 11:59    Post subject:  ffmpeg record your desktop but how to stop? [Solved]  

this code will run ffmpeg if installed and record your desktop actions into an mp4 video
I installed ffmpeg from Puppy 5.2 in the tweaks section of Lucid News / Quickpet
With Shadows help (programming buddy), we were able to select the screen resolution automatically Cool

Code:
#!/bin/sh
var="$(xrandr | grep '*')"
IFS=" "
set -- $var
ffmpeg -f x11grab -s $1 -r 25 -i :0.0 -sameq /mnt/home/lit/test.mpg


However . . .
to stop you use ctrl + alt + backspace
and then type 'xwin'

Is there a better way to stop the video? Smile

_________________
Puppy WIKI

Last edited by Lobster on Wed 29 Dec 2010, 13:23; edited 2 times in total
Back to top
View user's profile Send private message Visit poster's website 
puppyluvr


Joined: 06 Jan 2008
Posts: 3223
Location: Chickasha Oklahoma

PostPosted: Wed 29 Dec 2010, 12:06    Post subject:  

Very Happy Hello,
Have you tried a "killall ffmpeg" in a terminal??

_________________
Close the Windows, and open your eyes, to a whole new world
http://puppylinuxstuff.meownplanet.net/puppyluvr/
Puppy Linux Users Group on Facebook

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Wed 29 Dec 2010, 13:22    Post subject:  

Thanks Jay Smile

That will do fine have added that to LIT program and will be in next release
http://www.murga-linux.com/puppy/viewtopic.php?p=477503#477503

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 2027
Location: Maine, USA

PostPosted: Wed 29 Dec 2010, 17:36    Post subject:  

Lobster,

Please post the link to the ffmpeg you are using.
The ffmpeg's I find don't have x11grab.

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Thu 30 Dec 2010, 00:05    Post subject:  

Here are the i686 ffmpeg libraries that are *not* included in Lucid 5.2. It would be interesting to see if anyone noticed a difference or perhaps they even lowered the cpu usage in playing videos. Who knows?
They are optimized for i686 cpu's when they are compiled. The versions that *are* in luci-246 are compiled for i386 computers (lowest common denominator).
http://distro.ibiblio.org/pub/linux/distributions/puppylinux/pet-packages-lucid/ffmpeg_i686_libraries-5.2-lucid.pet

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Thu 30 Dec 2010, 03:05    Post subject:  

Lobster wrote:
Here are the i686 ffmpeg libraries that are *not* included in Lucid 5.2. It would be interesting to see if anyone noticed a difference or perhaps they even lowered the cpu usage in playing videos. Who knows?
They are optimized for i686 cpu's when they are compiled. The versions that *are* in luci-246 are compiled for i386 computers (lowest common denominator).
http://distro.ibiblio.org/pub/linux/distributions/puppylinux/pet-packages-lucid/ffmpeg_i686_libraries-5.2-lucid.pet


Lucid already has:
/usr/lib/sse2/libspeex.so.1.5.0
/usr/lib/sse2/libspeex.so.1
Back to top
View user's profile Send private message 
TheAsterisk!


Joined: 10 Feb 2009
Posts: 403
Location: SE Wisconsin, US

PostPosted: Thu 30 Dec 2010, 05:09    Post subject: Re: ffmpeg record your desktop but how to stop? [Solved]  

Lobster wrote:
Is there a better way to stop the video? Smile

I recall reading somewhere that if you run it from a terminal then Ctrl+C would halt/end recording, but I can't find the original source to confirm it. Still, worth a try and probably neater than killing FFmpeg if it works..
Back to top
View user's profile Send private message Visit poster's website 
jpeps

Joined: 31 May 2008
Posts: 3220

PostPosted: Thu 30 Dec 2010, 11:19    Post subject: Re: ffmpeg record your desktop but how to stop? [Solved]  

TheAsterisk! wrote:
Lobster wrote:
Is there a better way to stop the video? Smile

I recall reading somewhere that if you run it from a terminal then Ctrl+C would halt/end recording, but I can't find the original source to confirm it. Still, worth a try and probably neater than killing FFmpeg if it works..

works, but app is better run/stopped by clicking on icons so terminal doesn't appear in video.
Back to top
View user's profile Send private message 
puppyluvr


Joined: 06 Jan 2008
Posts: 3223
Location: Chickasha Oklahoma

PostPosted: Thu 30 Dec 2010, 12:16    Post subject:  

Very Happy Hello,
True, an apprun script with a pidof statement like:
Quote:
#!/bin/sh
if pidof ffmpeg | grep [0-9];then
killall ffmpeg
else exec ffmpeg
fi


Stop and start it with the same script....

_________________
Close the Windows, and open your eyes, to a whole new world
http://puppylinuxstuff.meownplanet.net/puppyluvr/
Puppy Linux Users Group on Facebook

Puppy since 2.15CE...
Back to top
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 2027
Location: Maine, USA

PostPosted: Fri 31 Dec 2010, 08:23    Post subject:  

hmm...anyone?

Code:
07:21:39: ~ > ffmpeg -f x11grab -s wxga -r 25 -i :0.0 -sameq ~/my_video.mpg
FFmpeg version 0.6, Copyright (c) 2000-2010 the FFmpeg developers
  built on Jul 15 2010 17:29:31 with gcc 4.2.2
  configuration: --prefix=/usr --cpu=i686 --enable-libmp3lame --enable-libx264 --enable-libfaac --enable-libfaad --enable-pthreads --enable-small --enable-postproc --enable-libvorbis --enable-gpl --enable-shared --enable-nonfree --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-debug --enable-bzlib --enable-zlib --enable-libspeex --enable-version3 --enable-runtime-cpudetect --enable-x11grab --enable-libtheora --enable-libxvid --enable-swscale --enable-mmx --enable-libvpx
  libavutil     50.15. 1 / 50.15. 1
  libavcodec    52.73. 2 / 52.73. 2
  libavformat   52.64. 2 / 52.64. 2
  libavdevice   52. 2. 0 / 52. 2. 0
  libswscale     0.11. 0 /  0.11. 0
  libpostproc   51. 2. 0 / 51. 2. 0
Unknown input format: 'x11grab'
07:21:42: ~ >

_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send private message Visit poster's website 
TheAsterisk!


Joined: 10 Feb 2009
Posts: 403
Location: SE Wisconsin, US

PostPosted: Fri 31 Dec 2010, 09:14    Post subject: Re: ffmpeg record your desktop but how to stop? [Solved]  

jpeps wrote:
works, but app is better run/stopped by clicking on icons so terminal doesn't appear in video.

I'd just as soon run the script with "xterm -e" in its *.desktop file, switch to another workspace, record my stuff, then switch back and halt/close it. You could trim away the few seconds of on-screen terminal time at the beginning and end with FFmpeg afterwards, too.

Well, to each his or her own, I suppose.
Back to top
View user's profile Send private message Visit poster's website 
stu90


Joined: 25 Feb 2010
Posts: 1401
Location: England. Dell Inspiron 1501. Dpup

PostPosted: Fri 31 Dec 2010, 09:34    Post subject:  

Use avidemux for trimming videos as you don't have to re-encode the video file.
Back to top
View user's profile Send private message 
01micko


Joined: 11 Oct 2008
Posts: 7841
Location: qld

PostPosted: Fri 31 Dec 2010, 11:06    Post subject:  

Quote:
hmm...anyone?

It's a compile time option... --enable-X11grab
Code:
Configuration options:
  --disable-static         do not build static libraries [no]
  --enable-shared          build shared libraries [no]
  --enable-gpl             allow use of GPL code, the resulting libs
                           and binaries will be under GPL [no]
  --enable-version3        upgrade (L)GPL to version 3 [no]
  --enable-nonfree         allow use of nonfree code, the resulting libs
                           and binaries will be unredistributable [no]
  --disable-doc            do not build documentation
  --disable-ffmpeg         disable ffmpeg build
  --disable-ffplay         disable ffplay build
  --disable-ffprobe        disable ffprobe build
  --disable-ffserver       disable ffserver build
  --disable-avdevice       disable libavdevice build
  --disable-avcodec        disable libavcodec build
  --disable-avcore         disable libavcore build
  --disable-avformat       disable libavformat build
  --disable-swscale        disable libswscale build
  --enable-postproc        enable GPLed postprocessing support [no]
  --disable-avfilter       disable video filter support [no]
  --disable-pthreads       disable pthreads [auto]
  --enable-w32threads      use Win32 threads [no]
  --enable-x11grab         enable X11 grabbing [no]
  --disable-network        disable network support [no]
  --disable-mpegaudio-hp   faster (but less accurate) MPEG audio decoding [no]
  --enable-gray            enable full grayscale support (slower color)
  --disable-swscale-alpha  disable alpha channel support in swscale
(list goes on)


Fortunately, ffmpeg compiles fairly easily, 0.6.1 is the latest stable.. I compiled out of svn for spup the other day, only issue was x264, I had to recompile that with --enable-shared

As for the stopping issue, I think ffmpeg has stop commands coded into it using the keyboard. A look at the man page might shed some light.

Happy New Year!

Cheers

_________________
Woof Mailing List | keep the faith Cool |
Back to top
View user's profile Send private message Visit poster's website 
trapster


Joined: 28 Nov 2005
Posts: 2027
Location: Maine, USA

PostPosted: Fri 31 Dec 2010, 11:09    Post subject:  

The one I have shows --enable-x11grab was configured. ?
_________________
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Puppeee4.31 + 1.0, Puppy4.10 + Lupu52
Currently using Slacko AND lupu52 w/ fluxbox
Back to top
View user's profile Send private message Visit poster's website 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Fri 31 Dec 2010, 11:46    Post subject:  

trapster

look over this build script
to get tips or links to sources
(or if you are a slacker just use the script )

http://slackware.org.uk/people/alien/restricted_slackbuilds/ffmpeg/build/ffmpeg.SlackBuild


Quote:
Fortunately, ffmpeg compiles fairly easily
Smile

this can be configured many ways and far from simple
if you want a full version

Joe

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0923s ][ Queries: 11 (0.0065s) ][ GZIP on ]