does not build with ffmpeg 0.11.1

Bug #1033820 reported by Alexander
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ren'Py
Fix Released
Medium
Tom Rothamel
Arch Linux
New
Undecided
Unassigned

Bug Description

Renpy version: 6.13.12
FFmpeg version: 0.11.1 (just in case: Arch Linux FFmpeg package - https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/ffmpeg)

building 'pysdlsound.sound' extension
gcc -pthread -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Os -fPIC -I. -I/usr/include -I/usr/include/SDL -I/usr/include/freetype2 -I/usr/include/$
gen/pysdlsound.sound.c: In function '__pyx_pf_10pysdlsound_5sound_check_error':
gen/pysdlsound.sound.c:557:13: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
gcc -pthread -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Os -fPIC -I. -I/usr/include -I/usr/include/SDL -I/usr/include/freetype2 -I/usr/include/$
gcc -pthread -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Os -fPIC -I. -I/usr/include -I/usr/include/SDL -I/usr/include/freetype2 -I/usr/include/$
gcc -pthread -DNDEBUG -march=i686 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -Os -fPIC -I. -I/usr/include -I/usr/include/SDL -I/usr/include/freetype2 -I/usr/include/$
ffdecode.c:197:5: error: unknown type name 'ByteIOContext'
ffdecode.c:245:32: error: 'FF_ER_CAREFUL' undeclared here (not in a function)
ffdecode.c:287:1: error: unknown type name 'ByteIOContext'
ffdecode.c: In function 'rwops_open':
ffdecode.c:290:5: error: unknown type name 'ByteIOContext'
ffdecode.c:290:25: warning: initialization makes pointer from integer without a cast [enabled by default]
ffdecode.c: In function 'audio_decode_frame':
ffdecode.c:1539:13: warning: 'avcodec_decode_audio3' is deprecated (declared at /usr/include/libavcodec/avcodec.h:3658) [-Wdeprecated-declarations]
ffdecode.c:1561:59: error: 'SAMPLE_FMT_S16' undeclared (first use in this function)
ffdecode.c:1561:59: note: each undeclared identifier is reported only once for each function it appears in
ffdecode.c: In function 'stream_component_open':
ffdecode.c:1819:8: error: 'AVCodecContext' has no member named 'error_recognition'
ffdecode.c:1828:5: warning: 'avcodec_open' is deprecated (declared at /usr/include/libavcodec/avcodec.h:3380) [-Wdeprecated-declarations]
ffdecode.c: In function 'dump_stream_info':
ffdecode.c:1956:5: error: unknown type name 'AVMetadataTag'
ffdecode.c:1957:52: error: 'AV_METADATA_IGNORE_SUFFIX' undeclared (first use in this function)
ffdecode.c:1958:40: error: request for member 'key' in something not a structure or union
ffdecode.c:1958:50: error: request for member 'value' in something not a structure or union
ffdecode.c: In function 'decode_thread':
ffdecode.c:1971:5: error: unknown type name 'AVFormatParameters'
ffdecode.c:1975:5: error: unknown type name 'ByteIOContext'
ffdecode.c:1995:7: error: request for member 'width' in something not a structure or union
ffdecode.c:1996:7: error: request for member 'height' in something not a structure or union
ffdecode.c:1997:7: error: request for member 'time_base' in something not a structure or union
ffdecode.c:1998:7: error: request for member 'pix_fmt' in something not a structure or union
ffdecode.c:2053:5: warning: 'av_find_stream_info' is deprecated (declared at /usr/include/libavformat/avformat.h:1357) [-Wdeprecated-declarations]
ffdecode.c:2281:27: error: request for member 'buffer' in something not a structure or union

Revision history for this message
Tom Rothamel (renpytom) wrote :

I've made several changes in 6.14 to remove the use of deprecated code from ffdecode.c.

ffdecode.c now compiles without warnings using libav, and will likely compile with ffmpeg.

You can check out the changes at the main Ren'Py branch, which is now hosted at github.

Changed in renpy:
milestone: none → 6.14
status: New → Fix Committed
importance: Undecided → Medium
assignee: nobody → Tom Rothamel (renpytom)
Revision history for this message
Alexander (alexanderr) wrote :

Could you please point out which commits can be used for patch creation? ffmpeg-0.11.1 is already in Arch repositories, and renpy (which could currently be only built from source in AUR) is inaccessible for Arch Linux users.

Revision history for this message
Alexander (alexanderr) wrote :

6.14.0 is out.. If only it was buildable!

no longer affects: archlinux
Revision history for this message
Tom Rothamel (renpytom) wrote :

What's not buildable about 6.14?

Revision history for this message
Alexander (alexanderr) wrote :

WARNING: _renpy is out of date, but RENPY_CYTHON isn't set.
WARNING: _renpybidi is out of date, but RENPY_CYTHON isn't set.
Could not find pysdlsound/sound.pyx.

Revision history for this message
zhangning (zhangn1985-gmail) wrote :

this is *BUILD* fix for renpy 6.13.12, and it is not test.

I can't load any game, and I don't have time and env to test it.

NOTICE:

+// AVFormatParameters params, *ap = &params;
+ AVDictionary *format_opts;

+#if 0
     err = av_open_input_stream(
         &ic,
         is->io_context,
         is->filename,
         fmt,
         ap);
-
+#else
+ err = avformat_open_input(
+ &ic,
+ is->filename,
+ fmt,
+ &format_opts);
+#endif
     // printf("Format name: %s\n", fmt->name);

this two part may be wrong. pls carefully check them.

Revision history for this message
zhangning (zhangn1985-gmail) wrote :

My patch mostly base on FFmpeg APIChangeLog.

but that two parts
and this part

- if(thread_count>1)
- avcodec_thread_init(enc, thread_count);
+// if(thread_count>1)
+// avcodec_thread_init(enc, thread_count);

I can't find any helpful information in the changelist.

Revision history for this message
zhangning (zhangn1985-gmail) wrote :

after Alexander's test, I have tried again, and add a new patch.

this patch remove old api to new.

fix one mistake

try to fix "stream open error: -2"

from FFmpeg document

3rd, 4th parameter of avformat_open_input can be NULL.

so I just put all NULL these two fields.

Revision history for this message
zhangning (zhangn1985-gmail) wrote :
Revision history for this message
Alexander (alexanderr) wrote :

still appears on Ren'Py 6.14.1:

ffdecode.c: In function 'audio_decode_frame':
ffdecode.c:790:13: warning: 'avcodec_decode_audio3' is deprecated (declared at /usr/include/libavcodec/avcodec.h:3658) [-Wdeprecated-declarations]
ffdecode.c: In function 'decode_thread':
ffdecode.c:1155:5: error: unknown type name 'AVFormatParameters'

Changed in renpy:
status: Fix Committed → New
Revision history for this message
Tom Rothamel (renpytom) wrote :

Can you try applying the change at:

https://github.com/renpy/renpy/commit/dd4fc916ecdeba6af7f176df37d8e978f2344c7f

And see if that fixes the problem? Thanks.

Revision history for this message
Alexander (alexanderr) wrote :

I have done it already; build process proceeds but there is no sound in games, neither with ffmpeg nor with libav.

Revision history for this message
Tom Rothamel (renpytom) wrote : Re: [Bug 1033820] Re: does not build with ffmpeg 0.11.1

On Tue, Aug 28, 2012 at 10:30 PM, Alexander <email address hidden>wrote:

> I have done it already; build process proceeds but there is no sound in
> games, neither with ffmpeg nor with libav.
>
>
When you import pysdlsound.sound into python directly, is there an error
message?

Revision history for this message
Alexander (alexanderr) wrote :

It does:

Traceback (most recent call last):
  File "./test.py", line 2, in <module>
    import pysdlsound.sound
  File "/usr/lib/python2.7/site-packages/pysdlsound/__init__.py", line 3, in <module>
    from sound import *
ImportError: /usr/lib/python2.7/site-packages/pysdlsound/sound.so: undefined symbol: av_close_input_stream

Note, that this does not happen if I use libav instead of ffmpeg. Unfortunately Arch developers decided to stick with ffmpeg, so I'd greatly appreciate if you fix this in compatible way.

Revision history for this message
Maks Verver (maksverver) wrote :

There is a very simple solution to the final problem: just replace the call to av_close_input_stream() in ffdecode.c with a call to av_close_input_file() instead (see attached patch).

Revision history for this message
Tom Rothamel (renpytom) wrote :

This will be in the next prerelease of 6.15.

Changed in renpy:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.