MaartenBaert / ssr

SimpleScreenRecorder, a screen recorder for Linux
http://www.maartenbaert.be/simplescreenrecorder/
GNU General Public License v3.0
2.55k stars 288 forks source link

‘AVPixelFormat’ has not been declared #1

Closed Szamanx0 closed 11 years ago

Szamanx0 commented 11 years ago

In file included from AV/Input/GLInjectInput.cpp:29:0: GUI/VideoPreviewer.h:48:91: error: ‘AVPixelFormat’ has not been declared

MaartenBaert commented 11 years ago

That didn't happen with my version of ffmpeg. Anyway, I've changed some includes, does it work now?

Szamanx0 commented 11 years ago

Not really

distro: Sabayon

ffmpeg -version ffmpeg version 0.8.6, Copyright (c) 2000-2013 the Libav developers built on Mar 31 2013 12:24:31 with gcc 4.7.2 This program is not developed anymore and is only provided for compatibility. Use avconv instead (see Changelog for the list of incompatible changes). ffmpeg 0.8.6 libavutil 51. 22. 1 / 51. 22. 1 libavcodec 53. 35. 0 / 53. 35. 0 libavformat 53. 21. 1 / 53. 21. 1 libavdevice 53. 2. 0 / 53. 2. 0 libavfilter 2. 15. 0 / 2. 15. 0 libswscale 2. 1. 0 / 2. 1. 0

The versions previous to "video preview" did compile

MaartenBaert commented 11 years ago

Turns out it's yet another incompatibility between different versions of libav/ffmpeg. Replacing AVPixelFormat with PixelFormat fixes it. I got the same error on Ubuntu 11.10 (which has an even older version of ffmpeg), but now it works.

Szamanx0 commented 11 years ago

One step forward and im stuck on: AV/Muxer.cpp: In member function ‘virtual void Muxer::run()’: AV/Muxer.cpp:289:80: error: ‘av_rescale_q’ was not declared in this scope AV/Muxer.cpp:293:80: error: ‘av_rescale_q’ was not declared in this scope

Szamanx0 commented 11 years ago

Also adding //Compatibility with old ffmpeg

ifndef AVPixelFormat

define AVPixelFormat PixelFormat

endif

in StdAfx.h also pases the original error

MaartenBaert commented 11 years ago

@ first reply: That doesn't make much sense, but you can try including <avutil/mathematics.h> right after <avutil/avutil.h>. This shouldn't be needed actually since <avutil/avutil.h> should include <avutil/mathematics.h>, but it might work.

I will try to get your distro in a VM so I can test it myself.

@ second reply: Yes, but that doesn't work with newer versions, where PixelFormat itself is a #define for AVPixelFormat.

Szamanx0 commented 11 years ago

Reverting

include <libavutil/mathematics.h>

in StdAfx.h and it works now. Now i need to figure out why glinject32 is not loading :)

MaartenBaert commented 11 years ago

Not loading? Do you mean the error messages during recording? They are harmless, it just means you're recording a 64-bit program that doesn't need the 32-bit library. 32-bit programs (e.g. WINE) will give you the opposite :).

Szamanx0 commented 11 years ago

Hmmm... than ill need to find a different reason why im getting Error: Could not get the size of the OpenGL application...

MaartenBaert commented 11 years ago

Which program are you trying to record?

Edit: recording glxgears on Sabayon XFCE in a VM seems to work ...

Szamanx0 commented 11 years ago

Wine applications. The native OpenGL apps (tested on Urban Terror) works fine P.S. an ability to launch the app in a different work space would be nice :)

MaartenBaert commented 11 years ago

Which WINE application? I've tested some myself (not on Sabayon though) and it does work for the ones I tried.

You could disable 'start application automatically' and then start it from a terminal in a different workspace. But why can't you just move the application to a new workspace after it has been started? :P

Szamanx0 commented 11 years ago

The only app i remember that i didn't manage to record was Prince of Persia forgotten sands(i guess the BS Overlays from Steam and Uplay might have something to do with it:) ... back on Mint. On Sabayon i have trouble with all wine apps im trying (i probably should try on that did work in the past).

And i know i can move it im simply lazy and would like the option :)

MaartenBaert commented 11 years ago

Okay, so I should try running a Windows app through WINE on Sabayon in a VM? :D

I haven't tried it with any steam games yet. It's possible that Steam uses LD_LIBRARY_PATH and/or LDPRELOAD internally, so that that GLInject library isn't loaded. Try running this while the game is open (after starting it from SSR): cat /proc/1234/environ | xargs -0 -l echo | grep LD Replace 1234 with the process ID of the game. What do you get? If only LD_LIBRARY_PATH is overwritten, you can fix it by moving the glinject libraries to /usr/lib or /usr/local/lib (SSR puts them in ~/.ssr because this doesn't require root).

In any case, 'record a fixed rectangle' combined with 'select window' should still work, although the resulting video won't be as smooth.

Szamanx0 commented 11 years ago

output from a wine app(not the steam one): INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE=0 LD_PRELOAD=libssr-glinject32.so libssr-glinject64.so LD_LIBRARY_PATH=/home/szamanx0/.ssr LD_PATH_ORIGIN=/home/szamanx0/.ssr INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE=0 DYLD_LIBRARY_PATH=

the other method work

MaartenBaert commented 11 years ago

Recording Steam games works if you change the settings: http://www.maartenbaert.be/simplescreenrecorder/recording-steam-games/

I'm not sure about the wine one. What do you mean by 'the other method work'?

Szamanx0 commented 11 years ago

Well i still have problems with wine (all the native opengl apps work) but not about that. You should update the README.md since it does not contain ./compile or a least ./prebuild in compilation instructions.

MaartenBaert commented 11 years ago

Done. I will try to reproduce your problem with WINE, do you have an application I can use to test it? Preferably something that's free and not too large to download or install.