Comskip Support Forum
http://www.kaashoek.com/comskip/

mpeg2dec.c errors when attempting to build from source.
http://www.kaashoek.com/comskip/viewtopic.php?f=5&t=1914
Page 1 of 1

Author:  padillaj3 [ Tue Mar 19, 2019 5:56 am ]
Post subject:  mpeg2dec.c errors when attempting to build from source.

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.c:16253:12: 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.c:10080:14: warning: ignoring return value of ‘fread’, declared with attribute warn_unused_result [-Wunused-result]
fread(&csbrightness[i], sizeof(int), 1, cutscene_file);
^
comskip.c: In function ‘InputReffer’:
comskip.c:13462:10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), raw); // Read first line
^
comskip.c:13481:10: 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.c:14100:10: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
fgets(line, sizeof(line), in_file); // Skip first line
^
comskip.c:14102:14: 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.c:1231:57: error: ‘AV_CODEC_FLAG_GRAY’ undeclared (first use in this function)
if (!hardware_decode) is->video_st->codec->flags |= AV_CODEC_FLAG_GRAY;
^
mpeg2dec.c:1231:57: note: each undeclared identifier is reported only once for each function it appears in
mpeg2dec.c:1259:31: error: ‘AVCodecContext’ has no member named ‘framerate’
if(is->video_st->codec->framerate.den && is->video_st->codec->framerate.num)
^
mpeg2dec.c:1259:69: error: ‘AVCodecContext’ has no member named ‘framerate’
if(is->video_st->codec->framerate.den && is->video_st->codec->framerate.num)
^
mpeg2dec.c:1261:57: 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.c:1269:9: 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.c:1269:89: 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.c:1274:9: 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.c:1654:50: error: ‘AV_CODEC_FLAG_GRAY’ undeclared (first use in this function)
if (!hardware_decode) codecCtx->flags |= AV_CODEC_FLAG_GRAY;
^
mpeg2dec.c:1751:5: warning: implicit declaration of function ‘av_dict_set_int’ [-Wimplicit-function-declaration]
if (!hardware_decode) av_dict_set_int(&myoptions, "gray", 1, 0);
^
mpeg2dec.c:1805:9: 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.c:1805:9: warning: implicit declaration of function ‘av_codec_get_max_lowres’ [-Wimplicit-function-declaration]
mpeg2dec.c: In function ‘log_callback_report’:
mpeg2dec.c:1877:5: 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.c:2002:24: 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.c:2002:58: 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.c:2004:42: 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.

Author:  erik [ Tue Mar 19, 2019 1:41 pm ]
Post subject:  Re: mpeg2dec.c errors when attempting to build from source.

What system are you building on?
Did you look at the travis script as inspiration on how to build?

Author:  padillaj3 [ Tue Mar 19, 2019 5:22 pm ]
Post subject:  Re: mpeg2dec.c errors when attempting to build from source.

I'm running Ubuntu 32bit.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty


I don't know what the Travis scripts are.

I just went with the instructions:
git clone git://github.com/erikkaashoek/Comskip
cd Comskip
sudo ./autogen.sh
sudo ./configure
sudo make


I did have to edit the configure file because I was getting the errors below:
Requested 'libavutil >= 54.7' but version of libavutil is 54.3.0
Requested 'libavformat >= 56.4' but version of libavformat is 56.1.0

So I put the following lines in the configure file:
ffmpeg_LIBS='/opt/ffmpeg/lib/pkgconfig'
ffmpeg_CFLAGS='/opt/ffmpeg/lib/pkgconfig'



I had been able to do this in the past as I have Comskip 0.81.089 in this computer, but I was looking to upgrade it.

Author:  erik [ Tue Mar 19, 2019 5:38 pm ]
Post subject:  Re: mpeg2dec.c errors when attempting to build from source.

The new comskip requires the latest libav
Other then that I do not know as I do not build myzelf.
Suggest you ask at github as there are some linux people

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/