Go Back   StepMania Forums > Help and Support > General questions
Connect with Facebook

Reply
 
Thread Tools Rating: Thread Rating: 6 votes, 3.33 average. Display Modes
Old 11-16-2009, 11:27 PM   #1
howl
Member
 
Join Date: Nov 2009
Posts: 90
howl is a 2 bar user
Reputation: 10

Post rating: Votes: 2 Score: 1rate    
Default [Patch] Update to make possible compile against the lastest FFMpeg API

I have take a lot of time before release this one because I wanted to test it as much as possible to avoid fix and re-fix. Is perfectly stable and makes StepMania to behave with latest FFMpeg versions equally to the same that is included nowadays statically.

This don't fix bugs present in stepmania FFMpeg interaction, for example "Don't let me be misunderstood" song video included in "DjJavixxxxx 1.5 Mix" stutters all the time equally as StepMania with it's actually statically linked ffmpeg.

video.m4 part of ffmpeg has been simplified but It could be simplest by checking ffmpeg using pkg_config, but it's loaded before gtk, so instead of messing with more m4 I left it with AC_SEARCH_LIBS. Perhaps a clean and update to a newer version in all the autogen related stuff could be fine.

This patch will break the build of any platform with ffmpeg linked statically, so it's needed to update before the ffmpeg libs included in stepmania svn. Linux distro packagers will take more use of this patch actually.

Patch: http://pastie.org/701873

DaVince you mean something like this? I don't see it necessary because the patches I do are very specific so I think if I just put that I have used code done by Petr Baudis is enough. Anyway, here you are.

ChangeLog:
Code:
Petr Baudis (3):
      video.m4: Add libswscale checks.
      MovieTexture_FFMpeg: Port img_convert to libswscale method.
      MovieTexture_Theora: Port img_convert to libswscale method.

David Santamarķa Rogado (howl) (12):
      video.m4: Simplify FFMpeg checks.
      ArchHooks_Unix: Correct ffmpeg include.
      MovieTexture_FFMpeg: Add and correct ffmpeg necessary includes.
      MovieTexture_FFMpeg: Replace avcodec_build() with avcodec_version(), avcodec_build() now doesn't exists and avcodec_version() has always return the same value of avcodec_build().
      MovieTexture_FFMpeg: Replace avcodec::offset_t type with int64_t type to complain the new FFMpeg API .
      MovieTexture_FFMpeg: Corrected seek component of RageProtocol to complain the new FFMpeg, if not videos with malformed headers fails to play.
      MovieTexture_FFMpeg: Fix compilation warning of RageProtocol.
      MovieTexture_FFMpeg: Add destruction conditions for swscale context to avoid possible crashes.
      MovieTexture_FFMpeg: Add initialization conditions for swscale context to avoid possible unused memory if there is no garbage collector and improve performance.
      MovieTexture_Theora: Add and correct ffmpeg necessary includes.
      MovieTexture_Theora: Add destruction conditions for swscale context to avoid possible crashes.
      MovieTexture_Theora: Add initialization conditions for swscale context to avoid possible unused memory if there is no garbage collector and improve performance.

Last edited by howl; 11-17-2009 at 03:01 AM..
howl is offline   Reply With Quote
Old 11-17-2009, 02:24 AM   #2
shakesoda
I code things sometimes
 
shakesoda's Avatar
 
Join Date: Jun 2007
Location: Seattle, WA
Posts: 5,967
shakesoda is an 8 bar user
Reputation: 10

Send a message via AIM to shakesoda Send a message via MSN to shakesoda Send a message via Skype™ to shakesoda
Post rating: Votes: 0 Score: 0rate    
Default

The only thing stopping me from committing this anywhere is that I don't know if it will work on Windows (I haven't got a clue how to build the lib there)
__________________

Coming when it's ready.
http://forum.shakesoda.com/
shakesoda is online now   Reply With Quote
Old 11-17-2009, 02:40 AM   #3
howl
Member
 
Join Date: Nov 2009
Posts: 90
howl is a 2 bar user
Reputation: 10

Post rating: Votes: 0 Score: 0rate    
Default

Well, it shouldn't work on windows or mac, the API of the included ffmpeg libs in stepmania svn differs so much in a used function, img_convert has been replaced by libswscale.

Also benefits for windows or mac aren't so much, only possible bugs that could be solved between ffmpeg versions, but for linux it add the possibility to use VDPAU to make the video decode work to be done by an nvidia GPU for some codecs.
howl is offline   Reply With Quote
Old 11-17-2009, 07:19 PM   #4
DaVince
Member
 
DaVince's Avatar
 
Join Date: Oct 2008
Location: Amsterdam, Netherlands
Posts: 384
DaVince is a 3 bar user
Reputation: 10

Send a message via AIM to DaVince Send a message via MSN to DaVince
Post rating: Votes: 0 Score: 0rate    
Default

Yeah, that's what I meant. A lot of detail in the changelog. Could be simplified in the end to who contributed what quickly, but at least a quick detail on what you did is now available for the changelog editors. :)

Nice work! But if it currently only works on Linux it still needs to be fixed before being committed, or a workaround should be added for the Windows/Mac versions to still use the statically linked library. It's more important to keep having SM work on all platforms.
__________________
My Stepfiles (1 new in August 2009. Latest stepfile)
DaVince is offline   Reply With Quote
Old 11-17-2009, 09:57 PM   #5
howl
Member
 
Join Date: Nov 2009
Posts: 90
howl is a 2 bar user
Reputation: 10

Post rating: Votes: 0 Score: 0rate    
Default

Is possible to make compiler conditions by checking ffmpeg version used to compile but that makes messy the code. I have done it anyway because the distro packagers will find it useful and when sm devs want to upgrade ffmpeg this leaves the work in a simple recompilation of win and mac libs included in the code, no need to do anything else.

PD: If you really want a code that can work with latest ffmpeg and the one included in sm I can do it, just check ffmpeg version, if img_convert exists and perhaps if offset_t type exists.
howl is offline   Reply With Quote
Old 11-18-2009, 10:34 PM   #6
pcvii
Member
 
Join Date: Nov 2009
Location: Lafayette, IN, USA
Posts: 24
pcvii is a 1 bar user
Reputation: 10

Post rating: Votes: 0 Score: 0rate    
Default

I was thinking of trying this one out. do i just patch and build like the pulseaudio patch? and it just uses the ffmpeg librarys that are installed?

I'd probably be trying it out now if i weren't chkdsk'ing my ntfs partitions. i wish i could just convert them to ext4. i had to boot to a windows install disk to chkdsk them for errors.
pcvii is offline   Reply With Quote
Old 11-18-2009, 11:41 PM   #7
howl
Member
 
Join Date: Nov 2009
Posts: 90
howl is a 2 bar user
Reputation: 10

Post rating: Votes: 0 Score: 0rate    
Default

This patch also breaks the Utils/build.sh utility, but adds the possibility to compile StepMania with the traditional method on modern distributions.

Way to do it:
First make sure you have the develop dependencies installed, they are the same as with the pulseaudio patch but you will need also:
Code:
sudo apt-get install libavutil-dev libavformat-dev libavcodec-dev libswscale-dev
for ffmpeg support using the one included in your distro.

Go to your directory where you take stepmania, and put this patch with the_name_you_want.patch and then:
Code:
svn co https://svn.stepmania.com/svn/trunk/stepmania
to take the latest stepmania svn or:
Code:
cd stepmania/
svn up
to update your previous one.

And now this changes:
Code:
cd stepmania/ <- if you didn't use the svn up method
patch -p0 -i ../the_name_you_want.patch
./autogen.sh
./configure
make
cp src/stepmania src/GtkModule.so ./
And it should be done, now:
Code:
./stepmania
to play the game.

Note that you won't need the PulseAudio patch with latest StepMania svn versions because is included with them.

Last edited by howl; 01-26-2010 at 10:27 PM.. Reason: ./make is really make
howl is offline   Reply With Quote
Old 11-19-2009, 07:00 AM   #8
pcvii
Member
 
Join Date: Nov 2009
Location: Lafayette, IN, USA
Posts: 24
pcvii is a 1 bar user
Reputation: 10

Post rating: Votes: 0 Score: 0rate    
Default

Code:
:~/Documents/stepmania$ patch -p0 -i ./pastie-701873.txt
patching file autoconf/m4/video.m4
patching file src/arch/ArchHooks/ArchHooks_Unix.cpp
patching file src/arch/MovieTexture/MovieTexture_FFMpeg.cpp
patching file src/arch/MovieTexture/MovieTexture_Theora.cpp
patch unexpectedly ends in middle of line
Hunk #8 succeeded at 689 with fuzz 1.
I'm not sure if thats right though i just patched it and will try to compile it. the 'patch unexpectedly ends in middle of line' thing has me worried
pcvii is offline   Reply With Quote
Old 11-19-2009, 07:23 AM   #9
pcvii
Member
 
Join Date: Nov 2009
Location: Lafayette, IN, USA
Posts: 24
pcvii is a 1 bar user
Reputation: 10

Post rating: Votes: 0 Score: 0rate    
Default getting an error

Code:
MovieTexture_FFMpeg.o: In function `MovieDecoder_FFMpeg::Init()':
MovieTexture_FFMpeg.cpp:(.text+0x82a): undefined reference to `av_free_packet'
MovieTexture_FFMpeg.o: In function `MovieDecoder_FFMpeg::ReadPacket()':
MovieTexture_FFMpeg.cpp:(.text+0x879): undefined reference to `av_free_packet'
MovieTexture_FFMpeg.cpp:(.text+0x8b0): undefined reference to `av_free_packet'
MovieTexture_FFMpeg.o: In function `MovieDecoder_FFMpeg::~MovieDecoder_FFMpeg()':
MovieTexture_FFMpeg.cpp:(.text+0x923): undefined reference to `av_free_packet'
MovieTexture_FFMpeg.o: In function `MovieDecoder_FFMpeg::~MovieDecoder_FFMpeg()':
MovieTexture_FFMpeg.cpp:(.text+0x983): undefined reference to `av_free_packet'
MovieTexture_FFMpeg.o:MovieTexture_FFMpeg.cpp:(.text+0x9e3): more undefined references to `av_free_packet' follow
collect2: ld returned 1 exit status
make[2]: *** [stepmania] Error 1
make[2]: Leaving directory `/home/robert/Documents/stepmania/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/robert/Documents/stepmania/src'
make: *** [all-recursive] Error 1
well it seems like it was compiling fine then blam.
pcvii is offline   Reply With Quote
Old 11-19-2009, 10:51 AM   #10
howl
Member
 
Join Date: Nov 2009
Posts: 90
howl is a 2 bar user
Reputation: 10

Post rating: Votes: 0 Score: 0rate    
Default

Mmm the patch was incorrectly grabbed from pastie, now I don't have time but I will look for the issue later or I will upload the patch to another place.
howl is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Patch] Make StepMania 4 alpha4 to manage the standard ogg extensions howl General questions 5 11-14-2009 06:06 PM
Can't compile lastest cvs satsuki_yatoshi StepMania releases 17 05-19-2008 09:13 PM
Which version of FFmpeg/libavcodec compiles with SM3.9? Dro Kulix General questions 3 10-10-2007 02:12 AM
Lastest CVS for Linux CRASHES in Network Play shigutso Crash questions 8 04-29-2007 06:46 PM
Use the latest ffmpeg with SM 4.0 sonicbhoc General questions 0 01-11-2007 11:58 PM


All times are GMT. The time now is 03:45 PM.


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.

Thanks to

SourceForge.net Logo