Page 1 of 1

Support for Video Recording

Posted: Wed Apr 14, 2010 11:17 pm
by filipe
Hi,

I started to implement the support to record videos natively in Uzem using ffmpeg. Unfortunately I had no time to keep going with the implementation for the next weeks, so I'm posting here a patch with what I have been doing in the case someone wants to give a try.

This is a video of Megatris recorded using Uzem:
[youtube]http://www.youtube.com/watch?v=KZ6VYWxXj8w[/youtube]

As you can see, the current code records just video with no audio support (the audio in the video is from youtube audio library). The implementation is far from be completed and the patch is a bit "dirty". I'm still learning ffmpeg and video formats. To add audio I expect some big changes in the patch.

The Makefile patched is for Linux, but if someone try to get involved using Windows, I hope that setup the ffmpeg dev package should be the minor of the problems :)

Hope you enjoy the partial work. Contributions are welcome. Actually I'm posting this work because it is stopped here for some time and I though someone would like to get involved.

Cheers,
Filipe Rinaldi

Re: Support for Video Recording

Posted: Thu Apr 15, 2010 12:37 am
by uze6666
Wow thanks, that's awesome! :mrgreen: My capture card died some months ago and I really wanted to make some video of the games. I won't have time either in the next weeks but I will indeed have a look at your code, ffmpeg is something I wanted to fiddle with for some time.

-Uze

Re: Support for Video Recording

Posted: Sat Apr 17, 2010 4:50 am
by paul
Great stuff, filipe.

The only way I know how to build on Windows is to follow this guide here. Also, you will probably need to make the following changes to libavformat/os_support.h:

Code: Select all

#if defined(__MINGW32__) && !defined(__MINGW32CE__)
#  include <fcntl.h>
#  define lseek(f,p,w) _lseeki64((f), (p), (w))
#endif /* defined(__MINGW32__) && !defined(__MINGW32CE__) */

+++ #if !defined(ETIMEDOUT) && defined(WSAETIMEDOUT) 
+++ #define ETIMEDOUT WSAETIMEDOUT 
+++ #endif 

static inline int is_dos_path(const char *path)
{
#if HAVE_DOS_PATHS
    if (path[0] && path[1] == ':')
        return 1;
#endif
    return 0;
}
I can provide a build if needed. However, a static link pushes uzem out to 20MB.

Re: Support for Video Recording

Posted: Sat Apr 17, 2010 5:22 pm
by uze6666
However, a static link pushes uzem out to 20MB.
I always prefer to have a single executable so let's use a static link. When we'll be at 200MB I'll perhaps reconsider... :lol:

-Uze

Re: Support for Video Recording

Posted: Sat Apr 17, 2010 6:56 pm
by paul
Looks like it strips down to 5.25MB, so no big deal after all.

Re: Support for Video Recording

Posted: Tue Jun 14, 2011 10:38 pm
by filipe
Hi Chaps,

It has been more than one year and once a while (you know those boring raining days) I try to revamp this patch.

The previous patch had only the video stream, this time I've added a proper muxer(container?) but audio is still not working properly.
There is an audio stream but I didn't find a format which accepts Uzebox's sample rate (15.7KHz) so we need to scale.

Please find attached the latest patch.
Patch was rebased on r184 and I've tested on Linux only.

I'm using the latest FFMPEG version:
configuration: --enable-shared --enable-pic --prefix=/usr/local/ffmpeg/
libavutil 51. 8. 0 / 51. 8. 0
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 3. 1 / 53. 3. 1
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 15. 1 / 2. 15. 1
libswscale 0. 14. 1 / 0. 14. 1

If you are feeling brave to try it:
* Checkout Uzebox revision 184
* From the uzem directory: "patch < UzemVideo_r184.patch"
* Update Makefile with your FFMPEG installation if necessary ("PKG_CONFIG_PATH=/usr/local/ffmpeg/lib/pkgconfig/")
To run (you can try different formats by changing the filename, but try to use only avi):
./uzem -v <filename>.avi <rom.hex>

Cheers,
-Filipe

Re: Support for Video Recording

Posted: Mon Nov 14, 2011 8:41 pm
by Harty123
Hi,

I'm looking for a compiled executable for Windows of this UZEM with video patch?!

-Harty

Re: Support for Video Recording

Posted: Sat Nov 19, 2011 4:38 am
by paul
I'm looking for a compiled executable for Windows of this UZEM with video patch?!
I used to have this, but I don't any longer. I also have no recollection of my previous posts in this thread, but maybe if you follow the link in my long-forgotten post, then you can get it working... :?

Re: Support for Video Recording

Posted: Sat Nov 19, 2011 1:59 pm
by Harty123
Hi Paul,

thx for your reply. Meanwhile I found another solution - a free screen recorder software called CAMSTUDIO. This works very fine with the standard emulator:

http://camstudio.org/


Here are some results:





It's also possible to record the sound with this tools...

-Harty

Re: Support for Video Recording

Posted: Sat Nov 19, 2011 7:27 pm
by uze6666
Awesome find Hartmut! :mrgreen: I've added a reference to the tool in the emulator's wiki page.

-Uze