AkarinVS / L-SMASH-Works

Works based on L-SMASH project; This repo focuses on the common portion and the VapourSynth plugin. AviSynth users please use https://github.com/HomeOfAviSynthPlusEvolution/L-SMASH-Works. ffmpeg 5.0+ please use ffmpeg-4.5 branch.
47 stars 11 forks source link

fails build with ffmpeg 5 #22

Open sl1pkn07 opened 2 years ago

sl1pkn07 commented 2 years ago

ffmpeg 5.0

[3/21] Compiling C object liblsmashsource.so.p/.._common_qsv.c.o
FAILED: liblsmashsource.so.p/.._common_qsv.c.o 
cc -Iliblsmashsource.so.p -I. -I../lsmashsource/AviSynth -I/usr/include/avisynth -fvisibility=hidden -flto=auto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c99 -O3 -Wno-sign-compare -DXXH_INLINE_ALL -D_FILE_OFFSET_BITS=64 -mfpmath=sse -msse2 -march=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -fvar-tracking-assignments -fdebug-prefix-map=/tmp/makepkg/avisynth-plugin-lsmashsource-git/src=/usr/src/debug -fPIC -MD -MQ liblsmashsource.so.p/.._common_qsv.c.o -MF liblsmashsource.so.p/.._common_qsv.c.o.d -o liblsmashsource.so.p/.._common_qsv.c.o -c ../lsmashsource/common/qsv.c
../lsmashsource/common/qsv.c: In function 'do_qsv_decoder_workaround':
../lsmashsource/common/qsv.c:69:9: error: unknown type name 'AVBSFContext'; did you mean 'AVCodecContext'?
   69 |         AVBSFContext            *bsf_ctx = NULL;
      |         ^~~~~~~~~~~~
      |         AVCodecContext
../lsmashsource/common/qsv.c:70:15: error: unknown type name 'AVBitStreamFilter'
   70 |         const AVBitStreamFilter *bsf     = av_bsf_get_by_name( "h264_mp4toannexb" );
      |               ^~~~~~~~~~~~~~~~~
../lsmashsource/common/qsv.c:70:44: warning: implicit declaration of function 'av_bsf_get_by_name' [-Wimplicit-function-declaration]
   70 |         const AVBitStreamFilter *bsf     = av_bsf_get_by_name( "h264_mp4toannexb" );
      |                                            ^~~~~~~~~~~~~~~~~~
../lsmashsource/common/qsv.c:70:44: warning: initialization of 'const int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
../lsmashsource/common/qsv.c:71:28: warning: implicit declaration of function 'av_bsf_alloc'; did you mean 'av_max_alloc'? [-Wimplicit-function-declaration]
   71 |         if( !bsf || (ret = av_bsf_alloc( bsf, &bsf_ctx )) < 0 )
      |                            ^~~~~~~~~~~~
      |                            av_max_alloc
../lsmashsource/common/qsv.c:73:46: error: request for member 'par_in' in something not a structure or union
   73 |         AVCodecParameters *codecpar = bsf_ctx->par_in;
      |                                              ^~
../lsmashsource/common/qsv.c:77:20: warning: implicit declaration of function 'av_bsf_init'; did you mean 'av_uninit'? [-Wimplicit-function-declaration]
   77 |         if( (ret = av_bsf_init( bsf_ctx )) < 0 )
      |                    ^~~~~~~~~~~
      |                    av_uninit
../lsmashsource/common/qsv.c:87:24: warning: implicit declaration of function 'av_bsf_send_packet'; did you mean 'avcodec_send_packet'? [-Wimplicit-function-declaration]
   87 |             if( (ret = av_bsf_send_packet( bsf_ctx, in_pkt )) < 0 )
      |                        ^~~~~~~~~~~~~~~~~~
      |                        avcodec_send_packet
../lsmashsource/common/qsv.c:89:19: warning: implicit declaration of function 'av_bsf_receive_packet'; did you mean 'avcodec_receive_packet'? [-Wimplicit-function-declaration]
   89 |             ret = av_bsf_receive_packet( bsf_ctx, &initializer );
      |                   ^~~~~~~~~~~~~~~~~~~~~
      |                   avcodec_receive_packet
../lsmashsource/common/qsv.c:99:9: warning: implicit declaration of function 'av_bsf_free'; did you mean 'av_dict_free'? [-Wimplicit-function-declaration]
   99 |         av_bsf_free( &bsf_ctx );
      |         ^~~~~~~~~~~
      |         av_dict_free
[7/21] Compiling C object liblsmashsource.so.p/.._common_decode.c.o
../lsmashsource/common/decode.c: In function 'select_hw_decoder':
../lsmashsource/common/decode.c:48:27: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   48 |     AVCodec *hw_decoder = avcodec_find_decoder_by_name( hw_decoder_name );
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lsmashsource/common/decode.c: In function 'find_decoder':
../lsmashsource/common/decode.c:73:22: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   73 |     AVCodec *codec = avcodec_find_decoder( codec_id );
      |                      ^~~~~~~~~~~~~~~~~~~~
../lsmashsource/common/decode.c:81:42: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   81 |             AVCodec *preferred_decoder = avcodec_find_decoder_by_name( *decoder_name );
      |                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../lsmashsource/common/decode.c: In function 'open_decoder':
../lsmashsource/common/decode.c:143:14: warning: implicit declaration of function 'av_cpu_count'; did you mean 'av_popcount'? [-Wimplicit-function-declaration]
  143 |           && av_cpu_count() > 1 )
      |              ^~~~~~~~~~~~
      |              av_popcount
[18/21] Compiling C object liblsmashsource.so.p/.._common_lwindex.c.o
FAILED: liblsmashsource.so.p/.._common_lwindex.c.o 
cc -Iliblsmashsource.so.p -I. -I../lsmashsource/AviSynth -I/usr/include/avisynth -fvisibility=hidden -flto=auto -fdiagnostics-color=always -DNDEBUG -Wall -Winvalid-pch -std=c99 -O3 -Wno-sign-compare -DXXH_INLINE_ALL -D_FILE_OFFSET_BITS=64 -mfpmath=sse -msse2 -march=native -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -fvar-tracking-assignments -fdebug-prefix-map=/tmp/makepkg/avisynth-plugin-lsmashsource-git/src=/usr/src/debug -fPIC -MD -MQ liblsmashsource.so.p/.._common_lwindex.c.o -MF liblsmashsource.so.p/.._common_lwindex.c.o.d -o liblsmashsource.so.p/.._common_lwindex.c.o -c ../lsmashsource/common/lwindex.c
../lsmashsource/common/lwindex.c:68:11: error: unknown type name 'AVBitStreamFilter'
   68 |     const AVBitStreamFilter    *bsf;
      |           ^~~~~~~~~~~~~~~~~
../lsmashsource/common/lwindex.c:69:5: error: unknown type name 'AVBSFContext'
   69 |     AVBSFContext               *bsf_ctx;
      |     ^~~~~~~~~~~~
../lsmashsource/common/lwindex.c: In function 'get_index_helper':
../lsmashsource/common/lwindex.c:1360:31: warning: implicit declaration of function 'av_bsf_get_by_name' [-Wimplicit-function-declaration]
 1360 |                 helper->bsf = av_bsf_get_by_name( "h264_mp4toannexb" );
      |                               ^~~~~~~~~~~~~~~~~~
../lsmashsource/common/lwindex.c:1360:29: warning: assignment to 'const int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 1360 |                 helper->bsf = av_bsf_get_by_name( "h264_mp4toannexb" );
      |                             ^
../lsmashsource/common/lwindex.c:1366:29: warning: assignment to 'const int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 1366 |                 helper->bsf = av_bsf_get_by_name( "aac_adtstoasc" );
      |                             ^
../lsmashsource/common/lwindex.c:1369:29: warning: assignment to 'const int *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
 1369 |                 helper->bsf = av_bsf_get_by_name( "mpeg4_unpack_bframes" );
      |                             ^
../lsmashsource/common/lwindex.c: In function 'apply_bsf':
../lsmashsource/common/lwindex.c:1431:44: error: request for member 'par_in' in something not a structure or union
 1431 |     if( !helper->bsf_ctx || helper->bsf_ctx->par_in->codec_id != ctx->codec_id )
      |                                            ^~
../lsmashsource/common/lwindex.c:1434:9: warning: implicit declaration of function 'av_bsf_free'; did you mean 'av_dict_free'? [-Wimplicit-function-declaration]
 1434 |         av_bsf_free( &helper->bsf_ctx );
      |         ^~~~~~~~~~~
      |         av_dict_free
../lsmashsource/common/lwindex.c:1435:81: error: request for member 'name' in something not a structure or union
 1435 |         if( (helper->bsf = av_bsf_get_by_name( bsf_name ? bsf_name : helper->bsf->name )) == NULL
      |                                                                                 ^~
../lsmashsource/common/lwindex.c:1436:20: warning: implicit declaration of function 'av_bsf_alloc'; did you mean 'av_max_alloc'? [-Wimplicit-function-declaration]
 1436 |          || (ret = av_bsf_alloc( helper->bsf, &helper->bsf_ctx )) < 0
      |                    ^~~~~~~~~~~~
      |                    av_max_alloc
../lsmashsource/common/lwindex.c:1437:68: error: request for member 'par_in' in something not a structure or union
 1437 |          || (ret = avcodec_parameters_from_context( helper->bsf_ctx->par_in, ctx )) < 0 )
      |                                                                    ^~
../lsmashsource/common/lwindex.c:1439:24: error: request for member 'time_base_in' in something not a structure or union
 1439 |         helper->bsf_ctx->time_base_in = ctx->time_base;
      |                        ^~
../lsmashsource/common/lwindex.c:1440:20: warning: implicit declaration of function 'av_bsf_init'; did you mean 'av_uninit'? [-Wimplicit-function-declaration]
 1440 |         if( (ret = av_bsf_init( helper->bsf_ctx )) < 0 )
      |                    ^~~~~~~~~~~
      |                    av_uninit
../lsmashsource/common/lwindex.c:1454:20: warning: implicit declaration of function 'av_bsf_send_packet'; did you mean 'avcodec_send_packet'? [-Wimplicit-function-declaration]
 1454 |         if( (ret = av_bsf_send_packet( helper->bsf_ctx, in_pkt )) < 0 )
      |                    ^~~~~~~~~~~~~~~~~~
      |                    avcodec_send_packet
../lsmashsource/common/lwindex.c:1456:15: warning: implicit declaration of function 'av_bsf_receive_packet'; did you mean 'avcodec_receive_packet'? [-Wimplicit-function-declaration]
 1456 |         ret = av_bsf_receive_packet( helper->bsf_ctx, out_pkt );
      |               ^~~~~~~~~~~~~~~~~~~~~
      |               avcodec_receive_packet
../lsmashsource/common/lwindex.c:1465:47: error: request for member 'par_out' in something not a structure or union
 1465 |     if( ctx->extradata_size != helper->bsf_ctx->par_out->extradata_size
      |                                               ^~
../lsmashsource/common/lwindex.c:1466:48: error: request for member 'par_out' in something not a structure or union
 1466 |      || memcmp( ctx->extradata, helper->bsf_ctx->par_out->extradata, helper->bsf_ctx->par_out->extradata_size ) )
      |                                                ^~
../lsmashsource/common/lwindex.c:1466:85: error: request for member 'par_out' in something not a structure or union
 1466 |      || memcmp( ctx->extradata, helper->bsf_ctx->par_out->extradata, helper->bsf_ctx->par_out->extradata_size ) )
      |                                                                                     ^~
../lsmashsource/common/lwindex.c:1470:69: error: request for member 'par_out' in something not a structure or union
 1470 |         ctx->extradata      = (uint8_t *)av_mallocz( helper->bsf_ctx->par_out->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE );
      |                                                                     ^~
../lsmashsource/common/lwindex.c:1473:48: error: request for member 'par_out' in something not a structure or union
 1473 |         memcpy( ctx->extradata, helper->bsf_ctx->par_out->extradata, helper->bsf_ctx->par_out->extradata_size );
      |                                                ^~
../lsmashsource/common/lwindex.c:1473:85: error: request for member 'par_out' in something not a structure or union
 1473 |         memcpy( ctx->extradata, helper->bsf_ctx->par_out->extradata, helper->bsf_ctx->par_out->extradata_size );
      |                                                                                     ^~
../lsmashsource/common/lwindex.c:1474:46: error: request for member 'par_out' in something not a structure or union
 1474 |         ctx->extradata_size = helper->bsf_ctx->par_out->extradata_size;
      |                                              ^~
../lsmashsource/common/lwindex.c: In function 'create_index':
../lsmashsource/common/lwindex.c:2594:78: error: 'AVStream' has no member named 'nb_index_entries'
 2594 |         if( adhp->dv_in_avi == 1 && format_ctx->streams[ adhp->stream_index ]->nb_index_entries == 0 )
      |                                                                              ^~
../lsmashsource/common/lwindex.c:2642:58: error: 'AVStream' has no member named 'index_entries'
 2642 |                 temp = (AVIndexEntry *)av_realloc( stream->index_entries, allocated_size );
      |                                                          ^~
../lsmashsource/common/lwindex.c:2658:27: error: 'AVStream' has no member named 'index_entries'
 2658 |                     stream->index_entries                = temp;
      |                           ^~
../lsmashsource/common/lwindex.c:2659:27: error: 'AVStream' has no member named 'index_entries_allocated_size'
 2659 |                     stream->index_entries_allocated_size = allocated_size;
      |                           ^~
../lsmashsource/common/lwindex.c:2660:27: error: 'AVStream' has no member named 'nb_index_entries'
 2660 |                     stream->nb_index_entries             = i;
      |                           ^~
../lsmashsource/common/lwindex.c:2666:58: error: 'AVStream' has no member named 'index_entries'
 2666 |                 temp = (AVIndexEntry *)av_realloc( stream->index_entries, allocated_size );
      |                                                          ^~
../lsmashsource/common/lwindex.c:2683:27: error: 'AVStream' has no member named 'index_entries'
 2683 |                     stream->index_entries                = temp;
      |                           ^~
../lsmashsource/common/lwindex.c:2684:27: error: 'AVStream' has no member named 'index_entries_allocated_size'
 2684 |                     stream->index_entries_allocated_size = allocated_size;
      |                           ^~
../lsmashsource/common/lwindex.c:2685:27: error: 'AVStream' has no member named 'nb_index_entries'
 2685 |                     stream->nb_index_entries             = i;
      |                           ^~
../lsmashsource/common/lwindex.c:2691:34: error: 'AVStream' has no member named 'index_entries'
 2691 |                 av_freep( &stream->index_entries );
      |                                  ^~
../lsmashsource/common/lwindex.c:2692:23: error: 'AVStream' has no member named 'index_entries_allocated_size'
 2692 |                 stream->index_entries_allocated_size = 0;
      |                       ^~
../lsmashsource/common/lwindex.c:2693:23: error: 'AVStream' has no member named 'nb_index_entries'
 2693 |                 stream->nb_index_entries             = 0;
      |                       ^~
../lsmashsource/common/lwindex.c:2702:108: error: 'AVStream' has no member named 'nb_index_entries'
 2702 |             print_index( index, "<StreamIndexEntries=%d,%d,%d>\n", stream_index, AVMEDIA_TYPE_VIDEO, stream->nb_index_entries );
      |                                                                                                            ^~
../lsmashsource/common/lwindex.c:2704:43: error: 'AVStream' has no member named 'nb_index_entries'
 2704 |                 for( int i = 0; i < stream->nb_index_entries; i++ )
      |                                           ^~
../lsmashsource/common/lwindex.c:2705:57: error: 'AVStream' has no member named 'index_entries'
 2705 |                     write_av_index_entry( index, &stream->index_entries[i] );
      |                                                         ^~
../lsmashsource/common/lwindex.c:2706:28: error: 'AVStream' has no member named 'nb_index_entries'
 2706 |             else if( stream->nb_index_entries > 0 )
      |                            ^~
../lsmashsource/common/lwindex.c:2708:72: error: 'AVStream' has no member named 'index_entries_allocated_size'
 2708 |                 vdhp->index_entries = (AVIndexEntry *)av_malloc( stream->index_entries_allocated_size );
      |                                                                        ^~
../lsmashsource/common/lwindex.c:2711:43: error: 'AVStream' has no member named 'nb_index_entries'
 2711 |                 for( int i = 0; i < stream->nb_index_entries; i++ )
      |                                           ^~
../lsmashsource/common/lwindex.c:2713:47: error: 'AVStream' has no member named 'index_entries'
 2713 |                     AVIndexEntry *ie = &stream->index_entries[i];
      |                                               ^~
../lsmashsource/common/lwindex.c:2717:51: error: 'AVStream' has no member named 'nb_index_entries'
 2717 |                 vdhp->index_entries_count = stream->nb_index_entries;
      |                                                   ^~
../lsmashsource/common/lwindex.c:2723:108: error: 'AVStream' has no member named 'nb_index_entries'
 2723 |             print_index( index, "<StreamIndexEntries=%d,%d,%d>\n", stream_index, AVMEDIA_TYPE_AUDIO, stream->nb_index_entries );
      |                                                                                                            ^~
../lsmashsource/common/lwindex.c:2725:43: error: 'AVStream' has no member named 'nb_index_entries'
 2725 |                 for( int i = 0; i < stream->nb_index_entries; i++ )
      |                                           ^~
../lsmashsource/common/lwindex.c:2726:57: error: 'AVStream' has no member named 'index_entries'
 2726 |                     write_av_index_entry( index, &stream->index_entries[i] );
      |                                                         ^~
../lsmashsource/common/lwindex.c:2727:28: error: 'AVStream' has no member named 'nb_index_entries'
 2727 |             else if( stream->nb_index_entries > 0 )
      |                            ^~
../lsmashsource/common/lwindex.c:2731:72: error: 'AVStream' has no member named 'index_entries_allocated_size'
 2731 |                 adhp->index_entries = (AVIndexEntry *)av_malloc( stream->index_entries_allocated_size );
      |                                                                        ^~
../lsmashsource/common/lwindex.c:2734:43: error: 'AVStream' has no member named 'nb_index_entries'
 2734 |                 for( int i = 0; i < stream->nb_index_entries; i++ )
      |                                           ^~
../lsmashsource/common/lwindex.c:2736:47: error: 'AVStream' has no member named 'index_entries'
 2736 |                     AVIndexEntry *ie = &stream->index_entries[i];
      |                                               ^~
../lsmashsource/common/lwindex.c:2740:51: error: 'AVStream' has no member named 'nb_index_entries'
 2740 |                 adhp->index_entries_count = stream->nb_index_entries;
      |                                                   ^~
../lsmashsource/common/lwindex.c: In function 'lwlibav_import_av_index_entry':
../lsmashsource/common/lwindex.c:3494:24: error: 'AVStream' has no member named 'index_entries'
 3494 |         av_free( stream->index_entries );
      |                        ^~
../lsmashsource/common/lwindex.c:3495:15: error: 'AVStream' has no member named 'index_entries'
 3495 |         stream->index_entries                = dhp->index_entries;
      |               ^~
../lsmashsource/common/lwindex.c:3496:15: error: 'AVStream' has no member named 'nb_index_entries'
 3496 |         stream->nb_index_entries             = dhp->index_entries_count;
      |               ^~
../lsmashsource/common/lwindex.c:3497:15: error: 'AVStream' has no member named 'index_entries_allocated_size'
 3497 |         stream->index_entries_allocated_size = dhp->index_entries_count * sizeof(AVIndexEntry);
      |               ^~
[20/21] Compiling C++ object liblsmashsource.so.p/libavsmash_source.cpp.o
ninja: build stopped: subcommand failed.

greetings

AkarinVS commented 2 years ago

Please use the fmpeg-4.5 branch when building when ffmpeg 5.

Message ID: @.***>

sl1pkn07 commented 2 years ago

works. tnx

sl1pkn07 commented 1 year ago

Hi. any update merge ffmpeg4.5 branch to master?

greetings

AkarinVS commented 1 year ago

There is currently no plan to merge that branch into master.

There are still a few patches that haven't been migrated to ffmpeg 5 yet, so lsmas built with ffmpeg 5 might have inaccurate seek in certain (rare) cases.

As one goal for lsmas is absolutely frame accurate seeking (contrary to popular belief, this is actually a hard requirement for any VS source filters as we have observed VS issuing non-sequential requests even with supposedly sequential encoding with vspipe), before all required ffmpeg patches are migrated, there is no plan to merge the branch for now. This serves as a warning to not use ffmpeg 5 with lsmas.

Of course, if you can tolerate occasional bad frames can use ffmpeg-4.5 branch.

sl1pkn07 commented 1 year ago

and update the ffmpeg-4.5 branch with the latest updates in master?

AkarinVS commented 1 year ago

merged latest master branch into ffmpeg-4.5.

Bartoloni commented 9 months ago

Hi guys, seems that you are the only that can un-stuck Hybrid project ( https://forum.selur.net/thread-3449.html ) anyone can help ? very thank you!