ShiftMediaProject / FFVS-Project-Generator

A program that can scan existing FFmpeg/LibAV source files and dynamically generate a Visual Studio project file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project generation fails with things like "--disable-encoders --disable-decoders --enable-decoder=h264"

oviano opened this issue · comments

In the above example, it does not create an AVCodec project....

I tested the supplied command line:
--disable-encoders --disable-decoders --enable-decoder=h264

A libavcodec.vcxproj project file was created and seemed to be correct. I am not able to reproduce your error. Make sure you are using the latest FFVS and if you have an actual command line the does produce an error then post it that.

Thank you for looking at this.

Here is the snippet from the bash script that does the building. I'm struggling to make it display as code below, there are of course backslashes at the end of each line of the configure command, but they aren't showing.

#!/bin/bash -x

rm -rf FFmpeg-Windows
mv SMP/project_generate.exe .
rm -rf SMP
mkdir SMP
mv project_generate.exe SMP/
cd SMP
./project_generate.exe --disable-programs
--disable-avdevice
--disable-avformat
--disable-avfilter
--disable-postproc
--disable-swresample
--disable-swscale
--disable-muxers
--disable-demuxers
--disable-encoders
--disable-decoders
--enable-decoder=h264
--enable-decoder=hevc
--enable-decoder=aac
--disable-parsers
--enable-parser=h264
--enable-parser=hevc
--enable-parser=aac
--disable-bsfs
--enable-bsf=h264_mp4toannexb
--enable-bsf=hevc_mp4toannexb
--enable-bsf=aac_adtstoasc
--disable-doc
--disable-network
--disable-bzlib
--disable-iconv
--disable-zlib
--disable-lzma
--disable-sdl2
--prefix=..\FFmpeg-Windows
--toolchain=msvc
|| exit 1

OK I have tested and found the issue. The avcodec lib requires that the null_bsf is enabled. You have disabled that when you disabled all bsf's. To allow avcodec to be created you must enable the null_bsf on the command line.

For reference the most recent version of FFVS when passed the "--loud" command line option will detail which options where auto disabled due to unmet dependencies (and which dependencies those were).

Interesting! Thanks for looking at it - oddly this is not the case for the other platforms I build for; on macOS, iOS, tvOS and Android avcodec builds with equivalent command line to the above (disable-bsf and just the listed select few enabled.)

Thanks for the tip re: --loud.

Hmm, so it gives a different error when I add the --enable-bsf=null:

  • ./project_generate.exe --disable-programs --disable-avdevice --disable-avformat --disable-avfilter --disable-postproc --disable-swresample --disable-swscale --disable-muxers --disable-demuxers --disable-encoders --disable-decoders --enable-decoder=h264 --enable-decoder=hevc --enable-decoder=aac --disable-parsers --enable-parser=h264 --enable-parser=hevc --enable-parser=aac --disable-bsfs --enable-bsf=h264_mp4toannexb --enable-bsf=hevc_mp4toannexb --enable-bsf=aac_adtstoasc --enable-bsf=null --disable-doc --disable-network --disable-bzlib --disable-iconv --disable-zlib --disable-lzma --disable-sdl2 '--prefix=..\FFmpeg-Windows' --toolchain=msvc
    Project generator (this may take several minutes, please wait)...
    Passing configure file...
    Outputting config.h...
    Outputting avconfig.h...
    Outputting ffversion.h...
    Outputting enabled components file libavfilter/filter_list.c...
    Outputting enabled components file libavcodec/codec_list.c...
    Outputting enabled components file libavcodec/parser_list.c...
    Outputting enabled components file libavcodec/bsf_list.c...
    Outputting enabled components file libavformat/demuxer_list.c...
    Outputting enabled components file libavformat/muxer_list.c...
    Outputting enabled components file libavdevice/indev_list.c...
    Outputting enabled components file libavdevice/outdev_list.c...
    Outputting enabled components file libavformat/protocol_list.c...
    Generating from Makefile (../libavcodec/MakeFile)...
    Generating from Makefile (../libavcodec/x86/MakeFile)...
    Generating missing DCE symbols (libavcodec)...
    Generating project exports file (libavcodec)...
    Invalid switch - "".
    Error: Errors detected during compilation :-
    error C2374: 'ff_h263_chroma_qscale_table': redefinition; multiple initialization
    Unknown error detected. See ffvs_log.txt for further details.

<<<<

Interesting! Thanks for looking at it - oddly this is not the case for the other platforms I build for; on macOS, iOS, tvOS and Android avcodec builds with equivalent command line to the above (disable-bsf and just the listed select few enabled.)

The dependency checking is a little bit different on FFVS and that can sometimes result in differences.

Hmm, so it gives a different error when I add the --enable-bsf=null:

That should now be fixed in the latest 1.9.1 version.

Thanks! It's getting closer, it creates the project now but gives some link errors at the end. Do you get these, or is this something about my build? I'm using FFmpeg 4.3 branch.

"C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj" (default target) (1) ->
1940(Link target) ->
1941 msmpeg4data.obj : error LNK2001: unresolved external symbol ff_inter_vlc [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1942 msmpeg4data.obj : error LNK2001: unresolved external symbol ff_inter_level [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1943 msmpeg4data.obj : error LNK2001: unresolved external symbol ff_inter_run [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1944 msmpeg4data.obj : error LNK2001: unresolved external symbol ff_mpeg4_intra_vlc [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1945 msmpeg4data.obj : error LNK2001: unresolved external symbol ff_mpeg4_intra_level [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1946 msmpeg4data.obj : error LNK2001: unresolved external symbol ff_mpeg4_intra_run [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1947 mpegvideo_motion.obj : error LNK2019: unresolved external symbol ff_h261_loop_filter referenced in function mpeg_motion_internal [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1948 mpegvideo_motion.obj : error LNK2019: unresolved external symbol ff_mspel_motion referenced in function mpv_motion_internal [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1949 mpegvideo_enc.obj : error LNK2001: unresolved external symbol ff_h263_format [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1950 mpegvideo_enc.obj : error LNK2001: unresolved external symbol ff_mpeg4_default_intra_matrix [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1951 mpegvideo_enc.obj : error LNK2001: unresolved external symbol ff_mpeg4_default_non_intra_matrix [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1952 C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP..\FFmpeg-Windows\bin\x64\avcodecd.dll : fatal error LNK1120: 11 unresolved externals [C:\AppVeyor-Workspaces\FFmpeg\windows\source\thirdparty\FFmpeg\SMP\libavcodec.vcxproj]
1953
1954 12 Warning(s)
1955 12 Error(s)
1956
1957

<<<<<

Actually I've seen something like this before.

In one of the examples above (ff_h261_loop_filter) there is this code in mpegvideo_motion.c:

if (!is_mpeg12 && (CONFIG_H261_ENCODER || CONFIG_H261_DECODER) &&
    s->out_format == FMT_H261) {
    ff_h261_loop_filter(s);
}

I vaguely recall that VS still gives a link error for this even though neither CONFIG_H261_ENCODER or CONFIG_H261_DECODER are enabled. I think previously I've added a modification to the FFmpeg code, but maybe there is some kind of setting that could be used in the project?

Not all the link errors above are of this nature though.

I vaguely recall that VS still gives a link error for this even though neither CONFIG_H261_ENCODER or CONFIG_H261_DECODER are enabled. I think previously I've added a modification to the FFmpeg code, but maybe there is some kind of setting that could be used in the project?

This is an issue that exists with msvc and there is nothing much that can be done. Thats why FFVS dynamically scans the source files and detects missing DCE (the cause of the error) information and will fill in the blanks. Obviously based on the above error then the DCE scan is missing some usages. So ill have to fix that.

The first issues are odd though. Ive checked the ffmpeg makefile and it definitely doesnt include the correct source files to stop those link errors (ff_inter_vlc etc. require h263data.c to be included along with msmpeg4data.c). So im not sure if this is an error with ffmpeg make files (that like dce only shows up with msvc) or for some reason the configuration is not including the correct dependencies. If you have a config.h file generated with the exact same command line but with ffmpeg natively (i.e. not FFVS - another platform will do) then that might help me track down whats going on.

Ok, here is a config.h from a macOS build with similar configuration:

https://ovcollyer-colebrooke.synology.me:5001/d/f/577028650887591424

And here is the corresponding config.log:

https://ovcollyer-colebrooke.synology.me:5001/d/f/577028828384245426

I also have these for iOS, tvOS and Android if it helps.

OK, thanks.

It turns out it was a dependency configuration handling issue. I think ive ironed it out now with the latest version.

Yes that has now built successfully. I haven’t actually tested it yet but I anticipate the at it will be ok.

Thank you.

Oliver.