mpeg2dec.c errors when attempting to build from source.
Posted: Tue Mar 19, 2019 5:56 am
Hello,
I'm trying to build comskip from the link:
git clone git://github.com/erikkaashoek/Comskip
but when I get to the make step I get many errors relating to mpeg2dec.c
Below is the output
Notebook-PC:~/Comskip$ sudo make
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.82.007\" -DPACKAGE_STRING=\"Comskip\ 0.82.007\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.82.007\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I. -Wall /opt/ffmpeg/lib/pkgconfig -DPROCESS_CC -DDONATOR -g -O2 -MT comskip-comskip.o -MD -MP -MF .deps/comskip-comskip.Tpo -c -o comskip-comskip.o `test -f 'comskip.c' || echo './'`comskip.c
comskip.c: In function ‘LoadSettings’:
comskip.c:8882:9: warning: implicit declaration of function ‘list_codecs’ [-Wimplicit-function-declaration]
list_codecs();
^
comskip.c: In function ‘set_fps’:
comskip.c12: warning: unused variable ‘old_fps’ [-Wunused-variable]
double old_fps = fps;
^
In file included from comskip.c:16:0:
comskip.c: In function ‘OpenOutputFiles’:
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6364:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6414:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6460:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6488:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6513:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
comskip.c: In function ‘OutputCleanMpg’:
comskip.c:8166:27: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
_write(outf, Buf, j);
^
comskip.c:8167:27: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
_write(outf, MPEG2SysHdr, sizeof(MPEG2SysHdr));
^
comskip.c: In function ‘LoadCutScene’:
comskip.c14: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(&csbrightness, sizeof(int), 1, cutscene_file);
^
comskip.c: In function ‘InputReffer’:
comskip.c10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), raw); // Read first line
^
comskip.c10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), raw); // Skip second line
^
comskip.c: In function ‘ProcessCSV’:
comskip.c10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), in_file); // Skip first line
^
comskip.c14: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), in_file); // Skip second line
^
gcc: warning: /opt/ffmpeg/lib/pkgconfig: linker input file unused because linking not done
mv -f .deps/comskip-comskip.Tpo .deps/comskip-comskip.Po
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.82.007\" -DPACKAGE_STRING=\"Comskip\ 0.82.007\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.82.007\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I. -Wall /opt/ffmpeg/lib/pkgconfig -DPROCESS_CC -DDONATOR -g -O2 -MT comskip-mpeg2dec.o -MD -MP -MF .deps/comskip-mpeg2dec.Tpo -c -o comskip-mpeg2dec.o `test -f 'mpeg2dec.c' || echo './'`mpeg2dec.c
mpeg2dec.c: In function ‘audio_packet_process’:
mpeg2dec.c:771:63: error: ‘AVFrame’ has no member named ‘channels’
data_size = av_samples_get_buffer_size(NULL, is->frame->channels,
^
mpeg2dec.c:776:92: error: ‘AVFrame’ has no member named ‘channels’
sound_to_frames(is, (short **)is->frame->data, is->frame->nb_samples ,is->frame->channels, is->frame->format);
^
mpeg2dec.c:779:38: error: ‘AVFrame’ has no member named ‘channels’
(is->frame->channels * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
^
mpeg2dec.c: In function ‘video_packet_process’:
mpeg2dec.c57: error: ‘AV_CODEC_FLAG_GRAY’ undeclared (first use in this function)
if (!hardware_decode) is->video_st->codec->flags |= AV_CODEC_FLAG_GRAY;
^
mpeg2dec.c57: note: each undeclared identifier is reported only once for each function it appears in
mpeg2dec.c31: error: ‘AVCodecContext’ has no member named ‘framerate’
if(is->video_st->codec->framerate.den && is->video_st->codec->framerate.num)
^
mpeg2dec.c69: error: ‘AVCodecContext’ has no member named ‘framerate’
if(is->video_st->codec->framerate.den && is->video_st->codec->framerate.num)
^
mpeg2dec.c57: error: ‘AVCodecContext’ has no member named ‘framerate’
frame_delay = (1/ av_q2d(is->video_st->codec->framerate) ) /* * is->video_st->codec->ticks_per_frame */ ;
^
mpeg2dec.c9: warning: implicit declaration of function ‘av_stream_get_parser’ [-Wimplicit-function-declaration]
repeat = av_stream_get_parser(is->video_st) ? av_stream_get_parser(is->video_st)->repeat_pict: 4;
^
mpeg2dec.c89: error: invalid type argument of ‘->’ (have ‘int’)
repeat = av_stream_get_parser(is->video_st) ? av_stream_get_parser(is->video_st)->repeat_pict: 4;
^
mpeg2dec.c9: warning: implicit declaration of function ‘av_frame_get_best_effort_timestamp’ [-Wimplicit-function-declaration]
best_effort_timestamp = av_frame_get_best_effort_timestamp(is->pFrame);
^
mpeg2dec.c: In function ‘stream_component_open’:
mpeg2dec.c50: error: ‘AV_CODEC_FLAG_GRAY’ undeclared (first use in this function)
if (!hardware_decode) codecCtx->flags |= AV_CODEC_FLAG_GRAY;
^
mpeg2dec.c5: warning: implicit declaration of function ‘av_dict_set_int’ [-Wimplicit-function-declaration]
if (!hardware_decode) av_dict_set_int(&myoptions, "gray", 1, 0);
^
mpeg2dec.c9: warning: ‘lowres’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:2524) [-Wdeprecated-declarations]
codecCtx->lowres = min(av_codec_get_max_lowres(codecCtx->codec),lowres);
^
mpeg2dec.c9: warning: implicit declaration of function ‘av_codec_get_max_lowres’ [-Wimplicit-function-declaration]
mpeg2dec.c: In function ‘log_callback_report’:
mpeg2dec.c5: warning: implicit declaration of function ‘av_log_format_line’ [-Wimplicit-function-declaration]
av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix);
^
mpeg2dec.c: In function ‘file_open’:
mpeg2dec.c24: error: ‘AVStream’ has no member named ‘r_frame_rate’
if(is->video_st->r_frame_rate.den && is->video_st->r_frame_rate.num)
^
mpeg2dec.c58: error: ‘AVStream’ has no member named ‘r_frame_rate’
if(is->video_st->r_frame_rate.den && is->video_st->r_frame_rate.num)
^
mpeg2dec.c42: error: ‘AVStream’ has no member named ‘r_frame_rate’
is->fps = av_q2d(is->video_st->r_frame_rate);
^
make: *** [comskip-mpeg2dec.o] Error 1
Any clue as to what's going on here?
Thank you.
I'm trying to build comskip from the link:
git clone git://github.com/erikkaashoek/Comskip
but when I get to the make step I get many errors relating to mpeg2dec.c
Below is the output
Notebook-PC:~/Comskip$ sudo make
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.82.007\" -DPACKAGE_STRING=\"Comskip\ 0.82.007\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.82.007\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I. -Wall /opt/ffmpeg/lib/pkgconfig -DPROCESS_CC -DDONATOR -g -O2 -MT comskip-comskip.o -MD -MP -MF .deps/comskip-comskip.Tpo -c -o comskip-comskip.o `test -f 'comskip.c' || echo './'`comskip.c
comskip.c: In function ‘LoadSettings’:
comskip.c:8882:9: warning: implicit declaration of function ‘list_codecs’ [-Wimplicit-function-declaration]
list_codecs();
^
comskip.c: In function ‘set_fps’:
comskip.c12: warning: unused variable ‘old_fps’ [-Wunused-variable]
double old_fps = fps;
^
In file included from comskip.c:16:0:
comskip.c: In function ‘OpenOutputFiles’:
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6364:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6414:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6460:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6488:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
platform.h:131:29: warning: ignoring return value of ‘getcwd’, declared with attribute warn_unused_result [-Wunused-result]
#define _getcwd(x, y) getcwd(x, y)
^
comskip.c:6513:17: note: in expansion of macro ‘_getcwd’
_getcwd(cwd, 256);
^
comskip.c: In function ‘OutputCleanMpg’:
comskip.c:8166:27: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
_write(outf, Buf, j);
^
comskip.c:8167:27: warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result]
_write(outf, MPEG2SysHdr, sizeof(MPEG2SysHdr));
^
comskip.c: In function ‘LoadCutScene’:
comskip.c14: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(&csbrightness, sizeof(int), 1, cutscene_file);
^
comskip.c: In function ‘InputReffer’:
comskip.c10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), raw); // Read first line
^
comskip.c10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), raw); // Skip second line
^
comskip.c: In function ‘ProcessCSV’:
comskip.c10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), in_file); // Skip first line
^
comskip.c14: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), in_file); // Skip second line
^
gcc: warning: /opt/ffmpeg/lib/pkgconfig: linker input file unused because linking not done
mv -f .deps/comskip-comskip.Tpo .deps/comskip-comskip.Po
gcc -DPACKAGE_NAME=\"Comskip\" -DPACKAGE_TARNAME=\"comskip\" -DPACKAGE_VERSION=\"0.82.007\" -DPACKAGE_STRING=\"Comskip\ 0.82.007\" -DPACKAGE_BUGREPORT=\"https://github.com/erikkaashoek/Comskip/issues\" -DPACKAGE_URL=\"\" -DPACKAGE=\"comskip\" -DVERSION=\"0.82.007\" -DHAVE_LIBM=1 -DHAVE_LIBPTHREAD=1 -I. -Wall /opt/ffmpeg/lib/pkgconfig -DPROCESS_CC -DDONATOR -g -O2 -MT comskip-mpeg2dec.o -MD -MP -MF .deps/comskip-mpeg2dec.Tpo -c -o comskip-mpeg2dec.o `test -f 'mpeg2dec.c' || echo './'`mpeg2dec.c
mpeg2dec.c: In function ‘audio_packet_process’:
mpeg2dec.c:771:63: error: ‘AVFrame’ has no member named ‘channels’
data_size = av_samples_get_buffer_size(NULL, is->frame->channels,
^
mpeg2dec.c:776:92: error: ‘AVFrame’ has no member named ‘channels’
sound_to_frames(is, (short **)is->frame->data, is->frame->nb_samples ,is->frame->channels, is->frame->format);
^
mpeg2dec.c:779:38: error: ‘AVFrame’ has no member named ‘channels’
(is->frame->channels * is->frame->sample_rate * av_get_bytes_per_sample(is->frame->format));
^
mpeg2dec.c: In function ‘video_packet_process’:
mpeg2dec.c57: error: ‘AV_CODEC_FLAG_GRAY’ undeclared (first use in this function)
if (!hardware_decode) is->video_st->codec->flags |= AV_CODEC_FLAG_GRAY;
^
mpeg2dec.c57: note: each undeclared identifier is reported only once for each function it appears in
mpeg2dec.c31: error: ‘AVCodecContext’ has no member named ‘framerate’
if(is->video_st->codec->framerate.den && is->video_st->codec->framerate.num)
^
mpeg2dec.c69: error: ‘AVCodecContext’ has no member named ‘framerate’
if(is->video_st->codec->framerate.den && is->video_st->codec->framerate.num)
^
mpeg2dec.c57: error: ‘AVCodecContext’ has no member named ‘framerate’
frame_delay = (1/ av_q2d(is->video_st->codec->framerate) ) /* * is->video_st->codec->ticks_per_frame */ ;
^
mpeg2dec.c9: warning: implicit declaration of function ‘av_stream_get_parser’ [-Wimplicit-function-declaration]
repeat = av_stream_get_parser(is->video_st) ? av_stream_get_parser(is->video_st)->repeat_pict: 4;
^
mpeg2dec.c89: error: invalid type argument of ‘->’ (have ‘int’)
repeat = av_stream_get_parser(is->video_st) ? av_stream_get_parser(is->video_st)->repeat_pict: 4;
^
mpeg2dec.c9: warning: implicit declaration of function ‘av_frame_get_best_effort_timestamp’ [-Wimplicit-function-declaration]
best_effort_timestamp = av_frame_get_best_effort_timestamp(is->pFrame);
^
mpeg2dec.c: In function ‘stream_component_open’:
mpeg2dec.c50: error: ‘AV_CODEC_FLAG_GRAY’ undeclared (first use in this function)
if (!hardware_decode) codecCtx->flags |= AV_CODEC_FLAG_GRAY;
^
mpeg2dec.c5: warning: implicit declaration of function ‘av_dict_set_int’ [-Wimplicit-function-declaration]
if (!hardware_decode) av_dict_set_int(&myoptions, "gray", 1, 0);
^
mpeg2dec.c9: warning: ‘lowres’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:2524) [-Wdeprecated-declarations]
codecCtx->lowres = min(av_codec_get_max_lowres(codecCtx->codec),lowres);
^
mpeg2dec.c9: warning: implicit declaration of function ‘av_codec_get_max_lowres’ [-Wimplicit-function-declaration]
mpeg2dec.c: In function ‘log_callback_report’:
mpeg2dec.c5: warning: implicit declaration of function ‘av_log_format_line’ [-Wimplicit-function-declaration]
av_log_format_line(ptr, level, fmt, vl2, line, sizeof(line), &print_prefix);
^
mpeg2dec.c: In function ‘file_open’:
mpeg2dec.c24: error: ‘AVStream’ has no member named ‘r_frame_rate’
if(is->video_st->r_frame_rate.den && is->video_st->r_frame_rate.num)
^
mpeg2dec.c58: error: ‘AVStream’ has no member named ‘r_frame_rate’
if(is->video_st->r_frame_rate.den && is->video_st->r_frame_rate.num)
^
mpeg2dec.c42: error: ‘AVStream’ has no member named ‘r_frame_rate’
is->fps = av_q2d(is->video_st->r_frame_rate);
^
make: *** [comskip-mpeg2dec.o] Error 1
Any clue as to what's going on here?
Thank you.