pAVrecord Video/webcam recorder (mpeg4, Theora, x264)

Audio editors, music players, video players, burning software, etc.
Message
Author
mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord Video/webcam recorder (mpeg4, Theora, x264)

#1 Post by mcewanw »

pAVrecord given a big quality of screencast upgrade via the following X11GRAB.hijack plugins (one for older ffmpeg/systems, the other for newer ffmpeg though probably the one for older systems will work fine for both):

http://www.murga-linux.com/puppy/viewto ... 345#921345

Some details concerning my other work/programs/opensource_contributions can be found inside threads:

NEW weX,weav,scrox Precord Premote DoMyFile DoMyCommand fokSyfEyeR xhippo-mod flite_hts_dotpet Pfetch WIAKAPPS Pcreole DebianDog_MintPup_DevContributions

NOTE WELL: Please remember to delete your old $HOME/.pavrecord config directory before installing this.

Changes 9.0.5:

# (YMD)2014/08/15:
Improved screencast handling including button for xwininfo and option to show capture area during capture.
Also fixed x11grab framerate entry.
Significantly improved video encoding functionality:
Added video bitrate entry box.
pAVrecord previously only provided constant bit rate video encoding mode but this latest version adds variable bit rate video encoding mode capability in addition to the default cbr mode (uses -qscale vbr option for bitrate < 32).
Some mods to the apps help text.

I suggest trying VideoBitrate value 512 kbps, which is the default if the entry box is left blank. That provides fairly good quality for most encoders.
For highest quality screencasts along with small resultant filesize, I suggest selecting x264 encoder. Even VideoBitrates as low as 128 (in kbps), using scast framerate of 10 fps, seemed to give reasonable results and small filesize.

Note well that for a given video bit rate you will get higher quality encoding if you reduce the frame rate. In other words, for a given video bit rate you can trade frame rate for quality whilst keeping the same recorded video filesize.


If you want variable bit rate video mode instead of the default constant bit rate video mode, enter a value less than 32 into the VariableBitrate box. pAVrecord then automatically uses vbr and the VariableBitrate value is used as the quality setting (using ffmpeg -qscale internally). A medium quality value of 5 works quite well with most codecs. 10 provides highest quality for Theora encoder (different encoders respond differently to qscale values between 1 and 31; with some encoders, quality goes down for larger qscale value, for some it goes up - you need to experiment...).

In default cbr video mode, for higher quality (but double file size), you could enter a VideoBitrate of 1024 kbps instead of 512 kbps, or use whatever value you wish (lowest provided cbr mode is 32 kbps, which gives very low quality of course).
-----

Previous notes, which still apply:

The recent pAVrecord works with either avconv or ffmpeg (though current avconv itself seems to have a bug with jpeg production at low frame rates, so ffmpeg is preferred). pAVrecord has been developed/tested_as_working on Slacko-6 beta, Puppy Precise 5.7.1, DebianDog, and Puppy Akita. Note that for Akita you need to create an empty file called noxvid in /etc/pavrecord; that causes it to use the alternative mpeg4 encoder - the same trick may be needed in some other Puppy distributions. Whether pAVrecord will work in earlier Puppies, or Quirky, Wary, or Racy, depends on the ffmpeg/avconv functionality they have. Read the program provided Help for more details and installation tips.

Note that this new pavrecord depends on either mplayer or cvlc, and ffmpeg or avconv. Complete functionality depends on the codecs provided by the installed ffmpeg or avconv. Neither ffplay nor avplay is absolutely required any more, but without one of these you will not be able to watch a preview of the video as it is being recorded. For ffplay/avplay your system needs xv graphics mode; x11 mode only apparently won't do for them.

This version has many changes and bug-fixes under the hood. In this new pAVrecord (and in latest Precord) it is now possible to alter much of its internal processing functionality via external code modules (I refer to it as 'hijack' facility). EDIT: The following post gives more details, via simple exemplars, on using hijack modules:

http://www.murga-linux.com/puppy/viewto ... 913#656913

If pavrecord ever fails to start, its config file is probably corrupted so simply delete your old $HOME/.pavrecord config directory and pavrecord will automatically rebuild it the next time it is re-started. Its config file is not known to become corrupted in normal use though.

"Some" Puppy versions may need to add ogv as a mime type.

By default, when using Theora for video capture, pavrecord uses -qscale 31 parameter for higher quality. You can overwrite this by entering, for example, -qscale 1, for lowest quality, in the Extra O/P Options entry box.


Further Notes.

1. For technical reasons, such as audio sync adjustment, pAVrecord records the video and audio track in separate files and then multiplexes them into a single video file at the end. This mechanism also makes it easy to dub the original video track with new audio. Use the Audio sync offset entry in the config GUI to correct for out of sync audio (whether it is out of sync with the video or not depends on the speed of your machine and the AV encoders selected).

2. Pausing recording works but isn't too useful because ffmpeg caches lots of video anyway. Another effect of this is that video and audio will become very much out of sync after pausing a recording.

3. When monitoring video recording, depending on your machine amongst other factors, you may experience a delay before the video window appears (it takes ages on my computer with x264 - but it does come eventually...). Also, with Theora, particularly since it is high quality by default, the video and audio may be a bit out of sync and you will need to adjust the value in the Audio sync entry box before recombining the audio and video track. The 0.5 seconds, as provided by default, works perfectly on my slowish computer with mp3 audio plus MPEG-4 video (Xvid) in an avi container.

Setting up pAVrecord Example:

Select Advanced (big) User Interface.

Select Target Directory: /root

Select Record Duration: 0 (for unlimited).
Also set Play Duration to 0.

Enter Audio sync offset (seconds): 0.5
(You will probably need to adjust that since audio delay is system/encoder dependent).

In AUDIO RECORD CONFIGURATION:

Select: mp3 (or ogg_q), cbr, bitrate 32k

In VIDEO RECORD CONFIGURATION:

Select video encoder: MPEG-4/10 (or Theora if ogg_q audio). Note that for screencast recording x264 (or maybe Theora) gives better quality.

Enter:

Frame Rate(fps) video: 15 (10 is probably high enough for a screencast),

vInputFormat: video4linux2 (not used during a screencast),

vDEVICE: /dev/video0 (if that is your video device; not used during a screencast),

vWidth 320, vHEIGHT 240 (not used during a screencast).

Leave ffmpeg/avconv Extra O/P options blank.
Note well: Any entered Extra I/P or O/P options are also used when screencasting.

Select container for combined A and V track: avi (or ogv if ogg_q and Theora)

For Combine AV auto, select as true.

For Combine AV del, select as false.
Note that the alternative true for checkbox del causes the separate A and V tracks to be automatically deleted after the final combined AV is produced.

Press Record button to record the A and V tracks (which, with above setting, are auto-combined into final avi container once Record Stop button is pressed).

With the above selections, three files are saved: the date-stamped video track, the date-stamped audio track and the combined AV video (whose name begins with the characters pAV). Note that it is possible to substitute an alternative audio or video track and to then create the final pAV combined AV video file using these by clicking the Combine AV button in the config gui.
-----
To view/hear result:

Method 1: Press Play controls play button. This method plays the individual video and audio tracks in parallel (allowing you to adjust the Audio sync offset).

Method 2: If audio sync offset set up is already fine, you can simply press the Play combined AV file button to play final combined AV video in your system video player (assuming Combine AV auto was selected).
-----

As well as having a GUI interface, pAVrecord can also be used from the commandline. It reads commandline args of the form:

[action][filename][duration] via stdin (e.g. pipe).

For example

Code: Select all

pavrecord [with no args starts GUI version]

pavrecord  rec  /root  anything.avi 10 [records without GUI]

pavrecord  play  /root  out.avi [plays without GUI]

or can use via pipe:

echo  play  /mnt/sda1  out.avi 20 | pavrecord -
[also plays without GUI; here using duration of 20 seconds]

If no outfile or duration parameter is supplied, pavrecord uses previous configuration as defaults.

pavrecord quit
does what you'd expect...

pavrecord --help
for commandline usage
Attachments
pavrecord_9.0.5_i386.deb.tar
Tested on DebianDog. Just remove the dummy tar.
(14.82 KiB) Downloaded 802 times
pavrecord-9.0.5.pet
Tested on Slacko 6 beta, Precise 5.7.1, Puppy Akita (see above notes).
(15.3 KiB) Downloaded 954 times
Last edited by mcewanw on Mon 05 Sep 2016, 08:29, edited 131 times in total.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

VERY simple examples of how to 'hijack' extend pavrecord

#2 Post by mcewanw »

NOTE: Hijack module names have been changed to use .hijack as an identifying extension for them. Previously existing hijacking modules should still work if renamed accordingly.

The following also now applies to the latest Precord (and mostly for DoMyFile, DoMyCommand/Premote also). For that, in the explanations below, just read word 'pavrecord' as 'precord' and so on - the attached example code should work in precord too if stored in ~/.precord folder.

Puppy as a experimenters' playground is, I feel, part of its usefulness and build philosophy. With that in mind, I have adapted pAVrecord (and planned others) such that experimenters can easily change major parts of its functionality via addon modules without needing to alter any of pavrecord's own code. The facility will also hopefully encourage new coders to experiment and practice coding with these already developed applications without risking any damage to the underlying main app itself. I'll start a new thread for 'hijack' module development later, and include more details in there.

Below follows some VERY simple examples showing pAVrecord (version 9.0.3 and above) new 'hijack' modular plugin extension facility in action.

To try these simple (and not designed as immediately useful) 'hijack' examples, just remove the dummy tar from each attached hijack module and copy them into $HOME/.pavrecord (e.g. /root/.pavrecord) and restart pavrecord and view the result in its config GUI (at GUI bottom). To remove the hijack module, just delete it from $HOME/.pavrecord.

Note that those 'hijack modules' that add to the GUI can be added and removed whilst pAVrecord is running. To see effect you can simply toggle between simple (small) GUI and the config GUI. It is all simple - best just to try it and see.

IMPORTANT NOTES:

1. I am planning to use this facility to write some new GUI apps that will use pAVrecord (and precord) as backends. In that light, you should be careful to store any 'hijack' modules of your own creation since the facility is designed to overwrite them when a new frontend app starts.

2. If you write your own hijack module, of course you have to code it carefully. If you make a mistake and pAVrecord refuses to start after deleting your hijack module, it just means that pAVrecord config file became corrupted. You would just need to delete $HOME/.pavrecord and it will automatically fix its own config file next time it is restarted.

3. pAVrecord is currently coded to use the following optional 'hijack' modules, which is probably enough for any of my planned future usage:

functions.hijack
recVideoTrack.hijack
mp3.hijack; wav.hijack; aac.hijack; flac.hijack; ogg.hijack
smallgui_addpanel.hijack
addbuttons.hijack
config_addpanel.hijack
maincode1.hijack
maincode2.hijack
maincode3.hijack
play_combined.hijack
make_avideo.hijack
recVideoTrack.hijack
X11GRAB.hijack
preview.hijack
vu.hijack
rec_hwcard.hijack
play_hwcard.hijack
play_player.hijack
stoprec.hijack
quit.hijack
small_dialog_.hijack
config_dialog_.hijack
commandline_args.hijack

All of these, are standard shell script code lines, except for hijack_smallgui_addpanel, hijack_addbuttons, and
hijack_config_addpanel, which are gtkdialog extracts. The easiest way for a programmer to find where these different hijacks take effect is just to use Geany or similar to search for the term 'hijack' in the /usr/bin/pavrecord code (being very careful not to accidentally modify the pavrecord code itself of course).
-----

General SCREENSHOTS of pavrecord (older version) in action:

First screenshot is of pAVrecord in small GUI mode being used in Slacko 5.4 beta.

Next screenshot is pAVrecord being used in Advanced/Config GUI mode on Slacko-5.3.3. Once you have the config set up to your liking you can always return to small GUI mode before beginning to record so that pavrecord occupies very little screen real estate in use.
Attachments
maincode1.hijack.tar
To add: Just remove dummy tar and put in /root/.pavrecord
(78 Bytes) Downloaded 737 times
addbuttons.hijack.tar
To add: Just remove dummy tar and put in /root/.pavrecord
(215 Bytes) Downloaded 737 times
config_addpanel.hijack.tar
To add: Just remove dummy tar and put in /root/.pavrecord
(158 Bytes) Downloaded 719 times
pavrecord_smallGUI.jpg
The pAVrecord small GUI during a recording session.
(34.02 KiB) Downloaded 8294 times
pavrecord_configGUI.jpg
The pAVrecord Config GUI
(63.07 KiB) Downloaded 7859 times
Last edited by mcewanw on Sat 02 Aug 2014, 09:15, edited 24 times in total.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord Audio/Video recorder 0.8.4 released

#3 Post by mcewanw »

Changes:

Version 0.8.4: ffmpeg Extra i/p options entry box now working.
AAC audio encoding added.
Running from commandline now working.
Fixed scheduling recordings via Pscheduler (Time button activates)
(Be careful if using Pscheduler. By default Pscheduler itself starts entered commands every minute... That is nothing to do with pAVrecord - so you have to remember to set appropriate timings once in the Pschedule application)

Note that I also removed ffmpeg entry box in(fps) since it isn't necessary (and would often not be wanted) and there is always the Extra I/P Options box for any extras that a user does want to add themself.
Last edited by mcewanw on Tue 09 Oct 2012, 05:51, edited 1 time in total.
github mcewanw

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#4 Post by pemasu »

I got this with Version 0.8.4: The selected Attachment does not exist anymore
By the way. Nice work. I havent managed to get my inbuild microphone to work yet. Otherwise really nice work. X11grab also worked with 0.8.3 version.

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord Audio/Video recorder 0.8.4 released

#5 Post by mcewanw »

pemasu wrote:I got this with Version 0.8.4: The selected Attachment does not exist anymore
By the way. Nice work. I havent managed to get my inbuild microphone to work yet. Otherwise really nice work. X11grab also worked with 0.8.3 version.
Sorry. I was re-uploading at the time you tried to fetch version 0.8.4. Should be there now.

If you can get your microphone working on any Puppy sound app, it should also work with pAVrecord [I hope I am correct saying that...]. I expect you know anyway. In the program code I select sound card with plughw (rather than just hw) at around line 278.

On my system it is just a matter of opening retrovol in full window mode (which the mixer button in pAVrecord does for you anyway) and setting my Mic1 as the Capture device; clicking on the Mic boost checkbox there; selecting Mic as "Mono output select device" (you would select Mix there if you wanted to record audio being heard from the Internet); and enable the Capture volume control and turn its amplitude up high.

In pAVrecord itself, on my own system at least, I just leave the "select soundcard" card and device checkboxes unchecked (meaning card,device 0,0)
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

remove old config folder before installing new pAVrec dotpet

#6 Post by mcewanw »

I forgot to say:

You should remove any previous /root/.pAVrecord config folder before installing new versions of pAVrecord. The newer versions contain new config variables, which the old config files wouldn't initialise correctly, such that it probably wouldn't start unless you delete the old config folder before installation.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord GUI A/Video recorder (mpeg4, Theora, x264) v.0.8.5

#7 Post by mcewanw »

Changes:

Version 0.8.5:

Allowed ffmpeg Extended I/P options entry for x11grap and jpeg image selection as well as video.
Internationalised commandline help.

NOTE WELL: To be sure the new version of pAVrecord will start up okay you should completely delete the old config folder /root/.pavrecord before installing the new dotpet. That's because it has some new config variables in the code which wouldn't be correctly initialised by the old config.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord Video/webcam recorder (mpeg4, Theora, x264)

#8 Post by mcewanw »

Version 0.8.6: Running from commandline now working.
includes AAC audio (bit rate and quality modes) and flac lossless
Fixed scheduling record via Pscheduler.
Fixed bug with directory selection.

NOTE WELL: To be sure the new version of pAVrecord will start up okay you should completely delete the old config folder /root/.pavrecord before installing the new dotpet. That's because this version has some new config variables in the code which wouldn't be correctly initialised by the old config.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord version 0.8.7 released

#9 Post by mcewanw »

# Changes:

# Version 0.8.7: Running from commandline now working.
# includes AAC audio (bit rate and quality modes) and flac lossless
# Fixed scheduling record via Pscheduler.
# Fixed scheduling record via Pscheduler.
# added -qscale 31 parameter for higher quality Theora
(you can overwrite this by entering, for example, -qscale 1, for low quality, in the Extra O/P Options entry box)
# Changed container name to ogv, which is the name for ogg video container recommended since 2007 by the relevant standards people. EDIT: "Some" Puppy versions probably needs to add ogv as a mime type though.

Developed/Tested and all options working well on Slacko-5.3.3.
Is only partially working in Wary 5.3 because Wary 5.3 doesn't include ffplay which is used to monitor the video as it is being recorded. ffplay is required because it accepts input via a pipe whilst mplayer does not seem to.

Also tested as working fine, to a large extent, on Puppy Precise (version 5.3.95.1), but not for all encoders since, for example, the ffmpeg currently provided there doesn't seem to include libxvid, libfaac, or libx264. It works well in Precise with ogg audio + theora video in an ogv container however - which is now the default selection when first installed. x11grab and jpeg generation also work in Precise.

For missing options to work in Puppy Precise 5.3.95.1, the ffmpeg there would have to include libx264m libfaac, libvorbis and libxvid in addition to the already provided x11grab, libvorbis, libmp3lame and libtheora etc. NOTE: aac audio could be recorded in Puppy Precise if I changed the aac encoder line to -acodec aac -strict experimental. However, that inbuilt ffmpeg encoder doesn't respond to audio quality parameters, as determined in tests, and also documented on the web - so libfaac is required for aac recording.

Works in Slacko beta 5.4 up to a point, but the audio and video stream mixing doesn't work because the ffmpeg there isn't recognising the standard decoder 'copy', so code like -codec copy is not working with that ffmpeg. Also the arecord VU display isn't outputting correctly in that puppy version i.e. this command doesn't work as it should in Slacko beta 5.4:

Code: Select all

arecord -vvv /dev/null 2>/dev/null
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord version 0.8.8 released

#10 Post by mcewanw »

# Changes:

# Version 0.8.8: fixed ffmpeg copy option and VU bugfixed. Now works fine in Slacko 5.4 beta too (which has newer ffmpeg version 0.11.x). I'm hopeful it will also now work in Pemasu's Dpup Exprimo 5x3412 (same ffmpeg version he tells me), which I'll download at some stage to check out since pAVrecord is being used there.

By default, when using Theora for video, pavrecord uses -qscale 31 parameter for higher quality. You can overwrite this by entering, for example, -qscale 1, for lowest quality, in the Extra O/P Options entry box.

When monitoring video recording, depending on your machine amongst other factors, you may experience a delay before the video window appears (it takes ages on my computer with x264 - but it does come eventually...). Also, with Theora, particularly since it is high quality by default, the video and audio may be a bit out of sync and you will need to adjust the value in the Audio sync entry box before recombining the audio and video track. The 1.2 seconds, as provided by default, works perfectly for me with mp3 audio plus MPEG-4 video (Xvid) in an avi container. Puppy Precise 5.3.95.1 doesn't currently have Xvid enabled but you can use ogg_q for audio, Theora for video, in an ogv container for that distribution version release.
github mcewanw

User avatar
pemasu
Posts: 5474
Joined: Wed 08 Jul 2009, 12:26
Location: Finland

#11 Post by pemasu »

Version 0.8.8: :D :D :D
The combining works and also my inbuild microphone now is captured. I played with options and Theora video encoder produces good visual quality.
I added .ogv to the mime definitions and it will be associated to the gnome-mplayer in next dpup release. Now it opens in Mplayer, not bad choice either.....

And thanks !!!

EDIT. Here is the pavrecord output when I launched it in the terminal. Remove the phony .gz. It is plain text file.
Attachments
pavrecord-output-in-terminal.gz
(2.17 KiB) Downloaded 1630 times

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#12 Post by 01micko »

I had to find one of my machines with a working mic.. :roll: .. the eee701Sd. I had a usb stick lying around with an earlier slacko-5.4 beta (basically all the same under the hood though) and pAVrecord worked nicely.

This will fill a gap in the Puppy suite, nice job!
Puppy Linux Blog - contact me for access

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

A couple of screenshots of pAVrecord in use

#13 Post by mcewanw »

Thought I'd better upload a couple of screenshots. You will find them in second post of this thread. i.e. at the link below:

http://www.murga-linux.com/puppy/viewto ... 913#656913

pAVrecord can be downloaded at first post in this thread.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord 0.8.9 released

#14 Post by mcewanw »

# Changes:

# Version 0.8.9: replaced aac -strict experimental with libfaac (sorry, I didn't realise I had left aac -strict experimental in 0.8.8 - I had forgotten to put it back to libfaac)

I note from a post by shinobar at http://www.murga-linux.com/puppy/viewto ... 852#658852 that he has provided a libav update for ffmpeg for the latest Precise beta. In that he supplies libvo-aacenc so I guess I will provide a special version of pAVrecord for Puppy Precise shortly to use that instead of libfaac

EDIT: Unfortunately I have just discovered that the PAE kernel in the new Precise beta does not run on my machine, so I cannot test it at the moment.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

New version for Precise will be uploaded tomorrow

#15 Post by mcewanw »

I'm working on a version for Precise plus shinobar's libav extra dotpet installed there.

There is a problem with libxvid on that one for some reason, so I am planning to work around that. Also, mplayer and gnome-mplayer on Precise doesn't like my method of delaying the audio track so refuses to play (or won't play the sound sometimes) - the same created video plays fine on the Slacko 5.4 beta versions of these programs. However, I think I have found a better way of delaying the audio anyway so I hope to produce new version(s) tomorrow. Will be a different dotpet for Precise though, because of that libxvid issue.
github mcewanw

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

pAVrecord version 0.9.0 released - Important update

#16 Post by mcewanw »

Download from first post in this thread. (Note that a modified version of precord has also been created especially for Puppy Precise because Precise currently uses a different codec for aac audio and needed an alternative for mpeg4).

Please remember to delete your old /root/.pavrecord config directory before installing this one because it has a new Audio sync offset default.

Note well that I have also included a version of pAVrecord especially made for Puppy Precise (pavrecord-precise-0.9.0). The ffmpeg (+libavformat extras provided by shinobar) currently provided for Precise require this modified version. But the normal one should be used in Slacko, Dpup Exprimo, or any other non-Precise derived system.

# Changes:

# Version 0.9.0: changed Audio sync offset method

# Version precise-0.9.0: As above, but also using libvo_aacenc instead of libfaac and using -vcodec mpeg4 -vtag xvid instead of libxvid (because libxvid would have needed extra and variable parameters to work in Precise).

pAVrecord videos weren't playable by gnome-mplayer in Precise and perhaps on some other users' systems more generally (though they played okay for me in Slacko). I discovered that Precise didn't like the method I used to delay the audio, but the videos play fine with the new delay method. Furthermore, I find in tests that the delay correction is now much more consistent across codecs.
Last edited by mcewanw on Mon 22 Oct 2012, 04:17, edited 2 times in total.
github mcewanw

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#17 Post by mavrothal »

Nice going mcewanw.

Tried pavrecord 0.9.0-precise, and although I can get audio fine, I can not get but the first frame in video.
Running from the command line I get

Code: Select all

# pavrecord 
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
overrun!!! (at least 7.901 ms long)
overrun!!! (at least 6.467 ms long)
overrun!!! (at least 11.191 ms long)
stdout: Broken pipe
If I run just the ffmpeg/fflpay command (# ffmpeg -f video4linux2 -s 360x240 -i /dev/video0 -r 15 -vcodec libtheora -qscale 1 -f avi - | tee /mnt/sda1/test.avi | ffplay /dev/video
) I get either I/O error on /dev/vido0 or "opperation not permitted" on /dev/video0.
From what I could understand the defending step is ffpaly. :?

BTW the mplayer tv// works OK as does the guvcview-precise, so should not be anything wrong with the hardware.

On a different note, regardless if it is going to work in my hardware or not, would be nice if the camera preview and the recording step would be uncoupled, so you can see what is going to be recorded before you start recording.
Maybe for v1.0 :wink:
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#18 Post by mcewanw »

mavrothal wrote: BTW the mplayer tv// works OK as does the guvcview-precise, so should not be anything wrong with the hardware.
First, I would good to know what the hardware is along with the exact version of Puppy you are running on it. (I am assuming you are running this on Puppy Precise with the ffmpeg provided there, which is what this version if designed for).

Second, it would be good if you sent me a copy of the output after running pAVrecord from a console. i.e. just enter into a console: pavrecord Then try recording a video (for simplicity use wav audio, mpeg1 video in an avi container. If the output you already sent is all you are getting, definitely need find out what video device (/dev/video0 or whatever) your hardware uses.

It is possible that your hardware is not using /dev/video0 for its input device. You will have to track that down somehow. Once you have checked that, if it is not /dev/video0 you should try entering whatever it is in the pavrecord config entry box vDEVICE.

If all fails, you indeed need to find out the simplest ffmpeg line that will record video for you and we can take it from there. Don't worry about the audio till then or ffplay in the commandline for now (ffplay is in Precise however, so that should not be causing the problem). The overrun stuff is not an error - that just means you were pressing the pause control and re-running repeatedly.

Finally, you say that mplayer tv// works. It might be helpful if you post the exact command you use for that to be the case.

I will think about adding a preview video facility at some stage later once the main application is tested as going well.
github mcewanw

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#19 Post by mavrothal »

mcewanw wrote:
mavrothal wrote: BTW the mplayer tv// works OK as does the guvcview-precise, so should not be anything wrong with the hardware.
First, I would good to know what the hardware is along with the exact version of Puppy you are running on it. (I am assuming you are running this on Puppy Precise with the ffmpeg provided there, which is what this version if designed for).

Second, it would be good if you sent me a copy of the output after running pAVrecord from a console. i.e. just enter into a console: pavrecord Then try recording a video (for simplicity use wav audio, mpeg1 video in an avi container. If the output you already sent is all you are getting, definitely need find out what video device (/dev/video0 or whatever) your hardware uses.

<snip>

Finally, you say that mplayer tv// works. It might be helpful if you post the exact command you use for that to be the case.
This precise 5.3.96 on a VIA machine.
Here is the data you asked:

Code: Select all

# pavrecord 
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
overrun!!! (at least 10.870 ms long)
overrun!!! (at least 7.016 ms long)
overrun!!! (at least 12.633 ms long)
stdout: Broken pipe
ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Jun 12 2012 16:37:58 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
Input #0, avi, from '/root/2012_10_18_071058.avi':
  Metadata:
    encoder         : Lavf53.21.0
  Duration: 9942:03:14.13, start: 0.000000, bitrate: N/A
    Stream #0.0: Video: mpeg4 (Simple Profile), yuv420p, 320x240 [PAR 1:1 DAR 4:3], 30 tbr, 30 tbn, 30 tbc
[mp3 @ 0x868f2c0] max_analyze_duration reached
[mp3 @ 0x868f2c0] Estimating duration from bitrate, this may be inaccurate
Input #1, mp3, from '/root/2012_10_18_071058.mp3':
  Duration: 00:00:18.43, start: 0.000000, bitrate: 32 kb/s
    Stream #1.0: Audio: mp3, 22050 Hz, mono, s16, 32 kb/s
Output #0, avi, to '/root/pAV2012_10_18_071058.avi':
  Metadata:
    ISFT            : Lavf53.21.0
    Stream #0.0: Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, 30 tbn, 30 tbc
    Stream #0.1: Audio: U[0][0][0] / 0x0055, 22050 Hz, mono, 32 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
  Stream #1.0 -> #0.1
Press ctrl-c to stop encoding
frame=    2 fps=  0 q=-1.0 Lsize=     105kB time=0.07 bitrate=12918.2kbits/s    
video:14kB audio:66kB global headers:0kB muxing overhead 31.813395%


# lspci
00:00.0 Host bridge: VIA Technologies, Inc. VX855/VX875 Host Bridge: Host Control (rev 03)
00:00.1 Host bridge: VIA Technologies, Inc. VX855/VX875 Error Reporting
00:00.2 Host bridge: VIA Technologies, Inc. VX855/VX875 Host Bus Control
00:00.3 Host bridge: VIA Technologies, Inc. VX855/VX875 DRAM Bus Control
00:00.4 Host bridge: VIA Technologies, Inc. VX855/VX875 Power Management Control
00:00.5 PIC: VIA Technologies, Inc. VX855/VX875 APIC and Central Traffic Control
00:00.6 Host bridge: VIA Technologies, Inc. VX855/VX875 Scratch Registers
00:00.7 Host bridge: VIA Technologies, Inc. VX855/VX875 North-South Module Interface Control
00:01.0 VGA compatible controller: VIA Technologies, Inc. VX855/VX875 Chrome 9 HCM Integrated Graphics
00:0c.0 SD Host controller: VIA Technologies, Inc. SDIO Host Controller (rev 10)
00:10.0 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev a0)
00:10.1 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev a0)
00:10.2 USB controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev a0)
00:10.4 USB controller: VIA Technologies, Inc. USB 2.0 (rev 90)
00:11.0 ISA bridge: VIA Technologies, Inc. VX855/VX875 Bus Control and Power Management
00:11.7 Host bridge: VIA Technologies, Inc. VX8xx South-North Module Interface Control
00:13.0 PCI bridge: VIA Technologies, Inc. VX855/VX875 PCI to PCI Bridge
00:14.0 Audio device: VIA Technologies, Inc. VT8237A/VT8251 HDA Controller (rev 20)


# cat /sys/devices/pci0000:00/0000:00:01.0/viafb-camera/video4linux/video0/uevent
MAJOR=81
MINOR=0
DEVNAME=video0


# mplayer tv:// -tv driver=v4l2:width=360:height=240:device=/dev/video0 -fps 15 


# ffmpeg -f video4linux2 -s 360x240 -i /dev/video0 -r 15  -f avi - | tee /mnt/sda1/test.avi | ffplay /dev/video
tee: /mnt/sda1/test.avi: No such file or directory
ffmpeg version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Jun 12 2012 16:37:58 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
avplay version 0.8.3-4:0.8.3-0ubuntu0.12.04.1, Copyright (c) 2003-2012 the Libav developers
  built on Jun 12 2012 16:37:58 with gcc 4.6.3
[video4linux2 @ 0x8f49a80] ioctl(VIDIOC_REQBUFS)
/dev/video: Device or resource busy
Couldn't get ffmeg to record. Without the "ffplay /dev/video" in the last command does not give any errors but does not record either. Specifying codec, dito.
Any suggestions on that part?
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

#20 Post by mcewanw »

mavrothal wrote: video:14kB audio:66kB global headers:0kB muxing overhead 31.813395%
Hi mavrothal. Just had a very quick glance at the data you provided. The above line in your output suggests that it successfully recorded both the video and the audio tracks and that they were successfully combined (muxed together) into the video file whose name would begin with the three letters pAV.... I'll check it out further and get back to you.

I trust you looked for the file in /root and nothing was there?

Did you see the webcam video in a window on screen as you attempted to record it?

"tee" is used as part of an output (save) command. So the message that file or directory not found is peculiar. Was the drive mounted?

Once the video is created and the audio and video tracks have been combined, you can either simply open the directory where the video has been saved and click on it to open it in the default video player, or click the playback button marked "AV" on pavrecords Advanced (big) config interface GUI.
github mcewanw

Post Reply