Author |
Message |
Icyos

Joined: 28 Jun 2011 Posts: 92 Location: UK
|
Posted: Wed 11 Jan 2012, 04:46 Post subject:
Using FFMPEG To Record Video & Sound in Puppy |
|
Hi All
Hope someone can help me can anyone please post the code for recording audio & video in any Puppy using FFMPEG from the command line, I can get it to work in Ubuntu but not in Puppy, I have managed to record video only in MacPup but no sound.
Must be easy but I cannot find any reference to it on the forums, many thanks all.
By using the following I can record video ONLY, can someone please add the audio bit please.
#!/bin/sh
var="$(xrandr | grep '*')"
IFS=" "
set -- $var
ffmpeg -f x11grab -s $1 -r 25 -i :0.0 -sameq /root/test.mpg
Thanks all so much.
_________________ Come to me TUBE : Icyos Puppy Linux YouTube
Puppy Slacko 5.31 Addict - Use With Caution.
icyos@hotmail.co.uk - MSN Me
|
Back to top
|
|
 |
zigbert

Joined: 29 Mar 2006 Posts: 6541 Location: Valåmoen, Norway
|
Posted: Wed 11 Jan 2012, 11:19 Post subject:
|
|
I have seldom seen a ffmpeg compile for Puppy including x11grab.
Could it be the size ???? I don't know
Sigmund
_________________ Stardust resources
|
Back to top
|
|
 |
Icyos

Joined: 28 Jun 2011 Posts: 92 Location: UK
|
Posted: Wed 11 Jan 2012, 15:03 Post subject:
|
|
Hi
The above when pasted into a terminal window records video no problem I just need to add sound and the -i pulse command dont work for me which is used in Ubuntu, wonder if -i alsa may work???
_________________ Come to me TUBE : Icyos Puppy Linux YouTube
Puppy Slacko 5.31 Addict - Use With Caution.
icyos@hotmail.co.uk - MSN Me
|
Back to top
|
|
 |
Barkin

Joined: 12 Aug 2011 Posts: 823
|
Posted: Wed 11 Jan 2012, 15:18 Post subject:
|
|
I saw something in the Audacity manual which may give a clue ...
Quote: | It is not necessary to use Audacity to record sounds playing on the computer. You can capture the sound from the application producing it before it reaches the sound device, which avoids capturing unwanted system sounds. This solution can be used even if there is no sound device. Note: this solution may not work on a system using PulseAudio but you can use PulseAudio Volume Control instead.
First you need to create (or edit if it exists) ~/.asoundrc file. Do it with your favorite plain text editor. Note: ~ is your home directory so change that to /home/john or whatever if you are not working in a Linux shell.
Code: | pcm.teeraw {
type empty
slave.pcm "tee:default,'/tmp/out.raw',raw"
# 48000 S16_LE 2ch (aplay -t raw -f dat)
} |
Now tell the application you are trying to record from to use the "teeraw" ALSA device for playback
|
http://wiki.audacityteam.org/wiki/Recording_audio_playing_on_the_computer#Using_the_ALSA_PCM_file
|
Back to top
|
|
 |
postfs1
Joined: 27 Mar 2010 Posts: 820
|
Posted: Wed 11 Jan 2012, 17:01 Post subject:
|
|
http://ffmpeg.org/ffmpeg.html#alsa-1
http://ffmpeg.org/ffmpeg.html
|
Back to top
|
|
 |
Icyos

Joined: 28 Jun 2011 Posts: 92 Location: UK
|
Posted: Thu 12 Jan 2012, 00:37 Post subject:
|
|
Hi All
Well I am delighted to tell you all I have cracked it this subject is now solved after 2 days I can finally use FFMPEG from the command line to make my screencasts in any version of PUppy.
Thanks everyone again I so love Puppy and this community.
_________________ Come to me TUBE : Icyos Puppy Linux YouTube
Puppy Slacko 5.31 Addict - Use With Caution.
icyos@hotmail.co.uk - MSN Me
|
Back to top
|
|
 |
Barkin

Joined: 12 Aug 2011 Posts: 823
|
Posted: Thu 12 Jan 2012, 03:55 Post subject:
|
|
Icyos wrote: | Well I am delighted to tell you all I have cracked it this subject is now solved after 2 days I can finally use FFMPEG from the command line to make my screencasts in any version of PUppy. |
I for one would be delighted to learn of this solution, can you tell us about it ?
|
Back to top
|
|
 |
Icyos

Joined: 28 Jun 2011 Posts: 92 Location: UK
|
Posted: Thu 12 Jan 2012, 04:15 Post subject:
|
|
Really aww bless you well i could tell you but I would have to kill you...........giggles sorry I am so happy i could burst, the problem was finding a universal command for ffmpeg which i could use for making me screencasts as I hate running puppies from virtual box, as most puppy distros come with ffconvert (ffmpeg) already installed as standard its the perfect soloution.
However unlike the Ubuntu operating system you cannot include the -i pulse bit in the command line as it wrecks it all.
So after messing around with all possible options and spending time on the ffmpeg help pages I finally got it right, through luck more than anything else, I can now use FFMPEG in all me screencasts and recordmydesktop and xvidcap are needed no more woop.
Oh yea I suppose you want the code.......giggles.............here it comes enjoy.
#!/bin/sh
var="$(xrandr | grep '*')"
IFS=" "
set -- $var
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $1 -r 25 -i :0.0 -sameq /root/test.avi
Just bash that in to your terminal and ffmpeg will start recording your desktop and sound at the same time, to end the recording just press CTRL+C.
I am so happy I could go bang
_________________ Come to me TUBE : Icyos Puppy Linux YouTube
Puppy Slacko 5.31 Addict - Use With Caution.
icyos@hotmail.co.uk - MSN Me
|
Back to top
|
|
 |
Barkin

Joined: 12 Aug 2011 Posts: 823
|
Posted: Thu 12 Jan 2012, 05:26 Post subject:
Subject description: No joy :¬( |
|
The code you put in your first post ("test.mpg") did enable me to record the desktop, with error messages, but the code in your last post ("test.avi") just generated error messages (attached). I'm using 525 kernel 2.6.33.2
Description |
successful recording of desktop "test.mpg", generated red error messages.
|

Download |
Filename |
red error messages with ''test,mpg'' recording of desktop.jpg |
Filesize |
112.49 KB |
Downloaded |
955 Time(s) |
Description |
screengrab of urxvt, failed ''test.avi''
|

Download |
Filename |
Monster error message.png |
Filesize |
80.25 KB |
Downloaded |
837 Time(s) |
|
Back to top
|
|
 |
Icyos

Joined: 28 Jun 2011 Posts: 92 Location: UK
|
Posted: Thu 12 Jan 2012, 05:47 Post subject:
|
|
Hi yes the reason is you have a ?-f remove the question mark please and you will be fine.
#!/bin/sh
var="$(xrandr | grep '*')"
IFS=" "
set -- $var
ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $1 -r 25 -i :0.0 -sameq /root/test.avi
Please use above code as is I have tried this on slacko 5.31 & Racy 5.2.2 I will try 5.25/5.28 today, I do assure you it works if you check me youtube site you will see todays video is made with ffmpeg.
_________________ Come to me TUBE : Icyos Puppy Linux YouTube
Puppy Slacko 5.31 Addict - Use With Caution.
icyos@hotmail.co.uk - MSN Me
|
Back to top
|
|
 |
Barkin

Joined: 12 Aug 2011 Posts: 823
|
Posted: Thu 12 Jan 2012, 12:25 Post subject:
|
|
Icyos wrote: | ... remove the question mark please and you will be fine.
|
Jesus H. tap-dancing Christ, it works !
and the frame-rate is a lot faster (smoother) than the video captured with the “test.mpg” code in your first post.
Thank you very much Icyos.
|
Back to top
|
|
 |
Icyos

Joined: 28 Jun 2011 Posts: 92 Location: UK
|
Posted: Thu 12 Jan 2012, 15:23 Post subject:
|
|
Giggles..................you are so welcome and yes it is smooth isnt it and it comes as standard in most Puppy distros, you really cant beat a Pup.
Anymore issues just let me know till then enjoy.
_________________ Come to me TUBE : Icyos Puppy Linux YouTube
Puppy Slacko 5.31 Addict - Use With Caution.
icyos@hotmail.co.uk - MSN Me
|
Back to top
|
|
 |
bill
Joined: 28 May 2008 Posts: 492
|
Posted: Tue 13 Mar 2012, 08:21 Post subject:
Using FFMPEG To Record Video & Sound in Puppy |
|
Topic of your code at : http://www.murga-linux.com/puppy/viewtopic.php?search_id=1576094798&t=75113
Hello icyos,I am running 3.3 Lucid Puppy Version :Lupu-520 Kernel :2.6.33.2 Alsa HDA NVidia Realtek ALC888
I lucked out with no problems installing the bash vidcap.sh but on execution I received the following screen :
Might you be able to tell me where I took the wrong turn ? Thanks in advance bill-Texas USA
|
Back to top
|
|
 |
bill
Joined: 28 May 2008 Posts: 492
|
Posted: Mon 19 Mar 2012, 17:54 Post subject:
Using FFMPEG To Record Video & Sound in Puppy Subject description: Work in progress |
|
For anyone doing Bash script for ffmpeg/alsa and get error message"cannot set
channel count to 1" hw:0,0 input/output error try changing hw:0,0 to plughw:0,0
|
Back to top
|
|
 |
Lobster
Official Crustacean

Joined: 04 May 2005 Posts: 15238 Location: Paradox Realm
|
Posted: Mon 19 Mar 2012, 20:56 Post subject:
|
|
I have added a front end to the script
- tested in Slacko
should work in Lucid, Wary, Racy and other Puppy's with ffmpeg
Files recorded are incremented automatically
Here is a youtube tutorial for Puppy hacker school students, truants and future and present tutors
http://youtu.be/gUwMCMjVXL8
Description |
|

Download |
Filename |
recgui.zip |
Filesize |
938 Bytes |
Downloaded |
1368 Time(s) |
_________________ YinYana AI Buddhism
Last edited by Lobster on Tue 20 Mar 2012, 06:30; edited 1 time in total
|
Back to top
|
|
 |
|