Menu

#497 ffmpeg feature does not compile with libavutil 52

v2.4.x
closed-fixed
None
Linux
FFMPEG
2016-02-27
2014-02-09
No

[rhurst@rampage ~]$ yum list ffmp*
Loaded plugins: langpacks, refresh-packagekit
Installed Packages
ffmpeg.x86_64 2.1.3-1.fc20 @rpmfusion-free-updates
ffmpeg-devel.x86_64 2.1.3-1.fc20 @rpmfusion-free-updates
ffmpeg-libs.x86_64 2.1.3-1.fc20 @rpmfusion-free-updates

With --enable-ffmpeg option, build fails:

Checked out 2.4.5 r27943M (GTK+ AMD64/x86_64 Linux glibc 2.18 GCC-4.8.2)

In file included from ffmpegdrv.c:37:0:
ffmpeglib.h:78:49: warning: ‘enum CodecID’ declared inside parameter list [enabled by default]
typedef AVCodec (avcodec_find_encoder_t)(enum CodecID);
^
ffmpeglib.h:78:49: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
ffmpegdrv.c: In function ‘ffmpegdrv_open_audio’:
ffmpegdrv.c:263:5: error: type of formal parameter 1 is incomplete
codec = (ffmpeglib.p_avcodec_find_encoder)(c->codec_id);
^
ffmpegdrv.c: In function ‘ffmpegdrv_open_video’:
ffmpegdrv.c:476:5: error: type of formal parameter 1 is incomplete
codec = (
ffmpeglib.p_avcodec_find_encoder)(c->codec_id);
^
ffmpegdrv.c: In function ‘ffmpegdrv_save’:
ffmpegdrv.c:711:13: error: type of formal parameter 1 is incomplete
&& (ffmpeglib.p_avcodec_find_encoder)(audio_codec) != NULL) {
^
ffmpegdrv.c:716:13: error: type of formal parameter 1 is incomplete
&& (
ffmpeglib.p_avcodec_find_encoder)(video_codec) != NULL) {
^

$ make distclean

SDL UI build works with ffmpeg disabled only:
$ ./configure --disable-arch --enable-sse --disable-ffmpeg --disable-midi --disable-rs232 --enable-sdlui --enable-fullscreen --with-sdlsound --enable-ethernet --with-uithreads CFLAGS="-O3 -ffast-math -g -pipe -Wall -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -march=native -mtune=native" || exit

GNOME UI build works with ffmpeg disabled only:
$ ./configure --disable-arch --enable-sse --disable-ffmpeg --disable-midi --disable-rs232 --enable-gnomeui --enable-fullscreen --without-oss --with-pulse --with-resid --enable-ethernet --with-uithreads CFLAGS="-O3 -ffast-math -g -pipe -Wall -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -m64 -march=native -mtune=native" || exit

$ make -j13

Without any POST warnings during configure, build also requires byacc, flex, pulseaudio-libs-devel, and vte-devel packages.

[rhurst@rampage ~]$ ll /usr/local/bin/
total 40296
-rwxr-xr-x 1 root root 315856 Feb 9 10:48 c1541
-rwxr-xr-x 1 root root 31048 Feb 9 10:48 cartconv
-rwxr-xr-x 1 root root 113576 Feb 9 10:48 petcat
-rwxr-xr-x 1 root root 2903928 Feb 9 10:46 sdl-x128
-rwxr-xr-x 1 root root 2437272 Feb 9 10:46 sdl-x64
-rwxr-xr-x 1 root root 1894632 Feb 9 10:46 sdl-x64dtv
-rwxr-xr-x 1 root root 2377272 Feb 9 10:46 sdl-x64sc
-rwxr-xr-x 1 root root 1832952 Feb 9 10:46 sdl-xcbm2
-rwxr-xr-x 1 root root 1880856 Feb 9 10:46 sdl-xpet
-rwxr-xr-x 1 root root 1879608 Feb 9 10:46 sdl-xplus4
-rwxr-xr-x 1 root root 1970584 Feb 9 10:46 sdl-xvic
-rwxr-xr-x 1 root root 1391000 Feb 9 10:48 vsid
-rwxr-xr-x 1 root root 2969912 Feb 9 10:48 x128
-rwxr-xr-x 1 root root 2512120 Feb 9 10:48 x64
-rwxr-xr-x 1 root root 1949960 Feb 9 10:48 x64dtv
-rwxr-xr-x 1 root root 2452120 Feb 9 10:48 x64sc
-rwxr-xr-x 1 root root 1873048 Feb 9 10:48 xcbm2
-rwxr-xr-x 1 root root 1991608 Feb 9 10:48 xcbm5x0
-rwxr-xr-x 1 root root 1918616 Feb 9 10:48 xpet
-rwxr-xr-x 1 root root 1922104 Feb 9 10:48 xplus4
-rwxr-xr-x 1 root root 2576376 Feb 9 10:48 xscpu64
-rwxr-xr-x 1 root root 2016696 Feb 9 10:48 xvic

Discussion

  • gpz

    gpz - 2014-02-18

    please post the output of ffmpeg -version. mine is like this and it works fine:

    libavutil 51. 73.101 / 51. 73.101
    libavcodec 54. 59.100 / 54. 59.100
    libavformat 54. 29.104 / 54. 29.104
    libavdevice 54. 2.101 / 54. 2.101
    libavfilter 3. 17.100 / 3. 17.100
    libswscale 2. 1.101 / 2. 1.101
    libswresample 0. 15.100 / 0. 15.100
    libpostproc 52. 0.100 / 52. 0.100

     
  • Robert Hurst

    Robert Hurst - 2014-02-20

    $ ffmpeg -version
    ffmpeg version 2.1.3
    built on Jan 25 2014 15:11:42 with gcc 4.8.2 (GCC) 20131212 (Red Hat 4.8.2-7)
    configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --incdir=/usr/include/ffmpeg --libdir=/usr/lib64 --mandir=/usr/share/man --arch=x86_64 --optflags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic' --enable-bzlib --disable-crystalhd --enable-frei0r --enable-gnutls --enable-libass --enable-libcdio --enable-libcelt --enable-libdc1394 --disable-indev=jack --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-openal --enable-libopencv --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libv4l2 --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --enable-avfilter --enable-avresample --enable-postproc --enable-pthreads --disable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-runtime-cpudetect
    libavutil 52. 48.101 / 52. 48.101
    libavcodec 55. 39.101 / 55. 39.101
    libavformat 55. 19.104 / 55. 19.104
    libavdevice 55. 5.100 / 55. 5.100
    libavfilter 3. 90.100 / 3. 90.100
    libavresample 1. 1. 0 / 1. 1. 0
    libswscale 2. 5.101 / 2. 5.101
    libswresample 0. 17.104 / 0. 17.104
    libpostproc 52. 3.100 / 52. 3.100

     
  • gpz

    gpz - 2014-02-20

    ok, so just another api breakage...

     
  • Robert Hurst

    Robert Hurst - 2014-02-21

    Of course! Don't you just love engineers? ;)
    Thanks for taking notice.

     
  • Leandro Nini

    Leandro Nini - 2014-03-01

    This patch should fix the problem

     
  • Robert Hurst

    Robert Hurst - 2014-03-01

    It compiles, thanks, but does not show any video encoding options, only audio.

    $ xvic
    ffmpeg avformat lib has version 371368, VICE expects 371368: full match
    getting symbol avcodec_open failed!
    ...

    And later when I pick 'Save media file ...', I am presented only screenshot media formats, no video. The console echoes this:

    FFMPEG Driver: avi
    AC: MP2(86016)
    AC: MP3(86017)
    AC: FLAC(86028)
    AC: PCM uncompressed(65536)
    VC: MPEG4 (DivX)(13)
    VC: MPEG1(1)
    VC: FFV1 (lossless)(34)
    VC: H264(28)
    VC: Theora(31)
    FFMPEG Driver: ogg
    AC: FLAC(86028)
    VC: Theora(31)
    FFMPEG Driver: wav
    FFMPEG Driver: mp3
    FFMPEG Driver: mp2
    Warning - Trying to read value from unknown resource FFMPEGAudioBitrate'. Warning - Trying to read value from unknown resourceFFMPEGVideoBitrate'.

     
  • Leandro Nini

    Leandro Nini - 2014-03-02

    Right, I should have tried it...
    Here's a revised patch, still it segfaults with the following backtrace:

    Program received signal SIGSEGV, Segmentation fault.
    0x00000000004ee30a in ffmpegmovie_encode_audio (audio_in=0x987c10 <ffmpegdrv_audio_in>) at ffmpegdrv.c:385
    385 pkt.pts = c->coded_frame->pts;
    (gdb) bt
    #0 0x00000000004ee30a in ffmpegmovie_encode_audio (audio_in=0x987c10 <ffmpegdrv_audio_in>) at ffmpegdrv.c:385
    #1 0x00000000004e8f85 in soundmovie_write (pbuf=0x854868 <snddata+72>, nr=896) at soundmovie.c:90
    #2 0x000000000045ac11 in sound_flush () at sound.c:1290
    #3 0x000000000045cee7 in vsync_do_vsync (c=<optimized out="">, been_skipped=0) at vsync.c:408
    #4 0x000000000051bc1a in vicii_raster_draw_handler () at vicii.c:457
    #5 0x00000000005165e2 in vicii_cycle_end_of_line () at vicii-cycle.c:221
    #6 vicii_cycle () at vicii-cycle.c:328
    #7 0x0000000000463bad in maincpu_mainloop () at ../6510dtvcore.c:1513
    #8 0x000000000045336a in main_program (argc=1, argv=<optimized out="">) at main.c:256
    #9 0x000000000053286d in main (argc=<optimized out="">, argv=<optimized out="">) at unixmain.c:44
    (gdb) print c
    $1 = (AVCodecContext ) 0x26b2120
    (gdb) print c->coded_frame
    $2 = (AVFrame
    ) 0x0
    (gdb) print pkt.size
    $3 = 0

     
  • Leandro Nini

    Leandro Nini - 2014-03-04

    Got it working with a small hack, not sure about the rationale though. Leave it to the ffmpeg experts...

     
  • Robert Hurst

    Robert Hurst - 2014-03-06

    Looks very encouraging! I will make a couple of videos.

    [rhurst@rampage vice]$ patch -d src/gfxoutputdrv < vice-2.4.6-libavcodec-55-v3.patch
    patching file ffmpegdrv.c
    patching file ffmpeglib.c
    patching file ffmpeglib.h

    [rhurst@rampage ~]$ xvic
    ffmpeg avformat lib has version 371368, VICE expects 371368: full match
    ffmpeg avcodec lib has version 372765, VICE expects 372765: full match
    ffmpeg avutil lib has version 343065, VICE expects 343065: full match
    ffmpeg swscale lib has version 020565, VICE expects 020565: full match

    VICE Version 2.4.6, rev 27963M
    OS compiled for: Linux glibc 2.18
    GUI compiled for: GTK+
    CPU compiled for: AMD64/x86_64
    Compiler used: GCC-4.8.2
    Current OS: (glibc 2.x)
    Current CPU: Intel Pentium Pro/II/III/Celeron/Core/Core 2/Atom

    Welcome to xvic, the free portable VIC20 Emulator.

    FFMPEG Driver: avi
    AC: MP2(86016)
    AC: MP3(86017)
    AC: FLAC(86028)
    AC: PCM uncompressed(65536)
    VC: MPEG4 (DivX)(13)
    VC: MPEG1(1)
    VC: FFV1 (lossless)(34)
    VC: H264(28)
    VC: Theora(31)
    FFMPEG Driver: ogg
    AC: FLAC(86028)
    VC: Theora(31)
    FFMPEG Driver: wav
    FFMPEG Driver: mp3
    FFMPEG Driver: mp2

     
  • Robert Hurst

    Robert Hurst - 2014-03-06

    Brilliant! Made a video, works phenomonal -- thank you for your diligence.

    http://robert.hurst-ri.us/2014/03/05/only-3583-bytes/

     

    Last edit: Robert Hurst 2014-03-06
  • Robert Hurst

    Robert Hurst - 2014-09-05

    This latest patch did not seem to make it into the latest 2.4.7, so a clean fetch comes back with the "getting symbol avcodec_open failed!" error as noted above.

     
  • Robert Hurst

    Robert Hurst - 2014-09-06

    ... and the Save media returns the same warnins as noted above further suggesting the patch did not make it in:

    FFMPEG Driver: avi
        AC: MP2(86016)
        AC: MP3(86017)
        AC: FLAC(86028)
        AC: PCM uncompressed(65536)
        VC: MPEG4 (DivX)(13)
        VC: MPEG1(1)
        VC: FFV1 (lossless)(34)
        VC: H264(28)
        VC: Theora(31)
    FFMPEG Driver: ogg
        AC: FLAC(86028)
        VC: Theora(31)
    FFMPEG Driver: wav
    FFMPEG Driver: mp3
    FFMPEG Driver: mp2
    
    Warning - Trying to read value from unknown resource FFMPEGAudioBitrate'.
    Warning - Trying to read value from unknown resource FFMPEGVideoBitrate'.
    
     

    Last edit: Robert Hurst 2014-09-06
  • gpz

    gpz - 2014-09-08

    weird, it compiles fine here (gtk and sdl), and my system is on libavutil 52 as well now:

    $ ffmpeg -version
    ffmpeg version 1.2.6
    built on Jul 23 2014 17:39:14 with gcc 4.7.3 (Gentoo 4.7.3-r1 p1.4, pie-0.5.5)
    configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-O2 -pipe -mtune=native -march=native' --extra-cflags='-O2 -pipe -mtune=native -march=native' --extra-cxxflags='-O2 -pipe -mtune=native -march=native' --disable-static --enable-gpl --enable-postproc --enable-avfilter --enable-avresample --disable-stripping --enable-version3 --disable-indev=v4l2 --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --disable-gnutls --enable-hardcoded-tables --enable-iconv --enable-network --disable-openssl --enable-ffplay --enable-vaapi --enable-vdpau --enable-zlib --enable-libvo-aacenc --disable-libvo-amrwbenc --enable-libmp3lame --disable-libfdk-aac --disable-libaacplus --disable-libfaac --enable-libtheora --disable-libtwolame --enable-libx264 --enable-libxvid --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --disable-libv4l2 --enable-libpulse --enable-x11grab --disable-libflite --disable-frei0r --disable-fontconfig --disable-libass --enable-libfreetype --disable-libsoxr --disable-pthreads --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libopenjpeg --disable-libbluray --disable-libcelt --disable-libgsm --disable-libmodplug --enable-libopus --disable-librtmp --disable-libschroedinger --disable-libspeex --enable-libvorbis --enable-libvpx --disable-amd3dnow --disable-amd3dnowext --disable-altivec --disable-avx --disable-mmxext --disable-ssse3 --disable-vis --disable-neon --cpu=host
    libavutil 52. 18.100 / 52. 18.100
    libavcodec 54. 92.100 / 54. 92.100
    libavformat 54. 63.104 / 54. 63.104
    libavdevice 54. 3.103 / 54. 3.103
    libavfilter 3. 42.103 / 3. 42.103
    libswscale 2. 2.100 / 2. 2.100
    libswresample 0. 17.102 / 0. 17.102
    libpostproc 52. 2.100 / 52. 2.100

     
  • Leandro Nini

    Leandro Nini - 2014-09-08

    The problem actually is with libavcodec 55, included in the ffmpeg 2.x package.

     
  • Thunderchild

    Thunderchild - 2014-09-29

    Trying to build vice 2.4 on Gentoo with ffmpeg 2.4.5 installed (libavcodec 55), I also got this error in ffmpeglib.h. Gentoo automatically applies this patch: http://sourceforge.net/p/vice-emu/patches/69/ to make vice build against newer ffmpegs. So searching for 'commodore vice "ffmpeg 2"', I found http://git.pld-linux.org/gitweb.cgi/packages/vice.git/commitdiff/87c2fd3955bfac45119b8d75113fe61d8dcb8b68. There is a file <vice-ffmpeg.patch>. When I apply it, I get "Reversed (or previously applied) patch detected!". But only applying the clean hunks made it compile through nonetheless. So I diffed the two. There were a few identical hunks and those that failed did so b/c Gentoo’s patch changes some of the lines that were contained as unchanged lines in the patch I found (Gentoo's patch is the newer one).

    The only real difference after putting the two together was the offending line in ffmpeglib.h (for me it’s line 73):

    -typedef AVCodec (avcodec_find_encoder_t) (enum CodecID);
    +typedef AVCodec (avcodec_find_encoder_t) (enum AVCodecID);

    By altering just that, it compiled through for me. I’m not sure though whether this is sane. I never looked at vice's code before. HTH

     
  • Robert Hurst

    Robert Hurst - 2014-10-02

    A fresh grab compiles now with no errors or warnings on src/gfxoutputdrv/*
    but it does not function:

    $ x64
    ffmpeg avformat lib has version 371368, VICE expects 371368: full match
    getting symbol avcodec_open failed!
    Reading configuration file `/home/rhurst/.vice/vicerc'.
    Alpha blending disabled
    
    *** VICE Version 2.4.7, rev 28488M ***
    OS compiled for: Linux glibc 2.18
    GUI compiled for: GTK+
    CPU compiled for: AMD64/x86_64
    Compiler used: GCC-4.8.3
    Current OS:  (glibc 2.18)
    Current CPU: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
    

    and a Save Media file outputs:

    (x64:28767): Gtk-WARNING **: Theme file for Oxygen_Black has no directories
    
    FFMPEG Driver: avi
        AC: MP2(86016)
        AC: MP3(86017)
        AC: FLAC(86028)
        AC: PCM uncompressed(65536)
        VC: MPEG4 (DivX)(13)
        VC: MPEG1(1)
        VC: FFV1 (lossless)(34)
        VC: H264(28)
        VC: Theora(31)
    FFMPEG Driver: ogg
        AC: FLAC(86028)
        VC: Theora(31)
    FFMPEG Driver: wav
    FFMPEG Driver: mp3
    FFMPEG Driver: mp2
    Warning - Trying to read value from unknown resource `FFMPEGAudioBitrate'.
    Warning - Trying to read value from unknown resource `FFMPEGVideoBitrate'.
    
     
  • Robert Hurst

    Robert Hurst - 2014-10-02

    Not certain if this helps any, but ffmpeg-devel from RPMfusion appears to include old_codec_ids.h with a comment block:
    /
    * This header exists to prevent new codec IDs from being accidentally added to
    * the deprecated list.
    * Do not include it directly. It will be removed on next major bump

    * Do not add new items to this list. Use the AVCodecID enum instead.
    */

     
  • Robert Hurst

    Robert Hurst - 2015-01-03

    Just a bump, using Fedora 21:

    $ x64
    
    getting symbol av_new_stream failed!
    
    *** VICE Version 2.4.13, rev 28976M ***
    OS compiled for: Linux glibc 2.20
    GUI compiled for: GTK+
    CPU compiled for: AMD64/x86_64
    Compiler used: GCC-4.9.2
    Current OS:  (glibc 2.20)
    Current CPU: Intel(R) Core(TM) i7-3930K CPU @ 3.20GHz
    
    X11: GTK version compiled with: 2.24 (xf86 ext:yes cairo:yes pango:yes VTE:no     hwscale:yes fullscreen:yes ui-threads:yes)
    Sound: Available sound devices: pulse alsa dummy fs dump wav voc iff aiff mp3 soundmovie
    

    Click Save Media File:

    FMPEG Driver: avi
        AC: MP2(86016)
        AC: MP3(86017)
        AC: FLAC(86028)
        AC: PCM uncompressed(65536)
        VC: MPEG4 (DivX)(13)
        VC: MPEG1(1)
        VC: FFV1 (lossless)(34)
        VC: H264(28)
        VC: Theora(31)
    FFMPEG Driver: ogg
        AC: FLAC(86028)
        VC: Theora(31)
    FFMPEG Driver: wav
    FFMPEG Driver: mp3
    FFMPEG Driver: mp2
    Warning - Trying to read value from unknown resource `FFMPEGAudioBitrate'.
    Warning - Trying to read value from unknown resource `FFMPEGVideoBitrate'.
    

    Looks like all newer versions:

    $ ffmpeg -version
    ffmpeg version 2.4.5 Copyright (c) 2000-2014 the FFmpeg developers
    built on Dec 21 2014 13:10:54 with gcc 4.9.2 (GCC) 20141101 (Red Hat 4.9.2-1)
    libavutil      54.  7.100 / 54.  7.100
    libavcodec     56.  1.100 / 56.  1.100
    libavformat    56.  4.101 / 56.  4.101
    libavdevice    56.  0.100 / 56.  0.100
    libavfilter     5.  1.100 /  5.  1.100
    libavresample   2.  1.  0 /  2.  1.  0
    libswscale      3.  0.100 /  3.  0.100
    libswresample   1.  1.100 /  1.  1.100
    libpostproc    53.  0.100 / 53.  0.100
    
     

    Last edit: Robert Hurst 2015-01-03
  • Tristan Miller

    Tristan Miller - 2015-01-09

    I get similar x64 output to Robert Hurst, with the following interesting exception at the beginning:

    $ x64
    ffmpeg avformat lib has version 373064, VICE expects 373064: full match
    getting symbol avcodec_open failed!
    

    I'd love to make videos with VICE and am available to help with testing/troubleshooting.

     
  • Tristan Miller

    Tristan Miller - 2015-01-09

    I just tried applying the patches from vice-2.4.6-libavcodec-55-v3.patch above to the VICE 2.4.13 sources. (The files ffmpegdrv.c and ffmpeglib.c get patched automatically, but ffmpeglib.h needs to be patched manually.) This way the "Save media file" command from the Snapshot menu shows "FFMPEG" in the "Image Format" drop-down list, and allows me to select the video settings. Unfortunately, as soon as I hit the Save button, VICE crashes with a segfault.

     
  • gpz

    gpz - 2015-03-18
    • Category: --> FFMPEG
     
  • Robert Hurst

    Robert Hurst - 2015-10-03

    I can confirm that --enable-external-ffmpeg --enable-lame are working for me, thank you!

     
  • gpz

    gpz - 2015-10-03

    ok, closing...

     
  • gpz

    gpz - 2015-10-03
    • status: open --> pending-fixed
     
  • Marco van den Heuvel

    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.