Bug#739243: FTBFS with libav10
On Thu, Mar 06, 2014 at 10:15:36PM +0100, Alberto Garcia wrote: On Thu, Mar 06, 2014 at 09:54:25AM +0100, Anton Khirnov wrote: Now it should compile; sadly I cannot test it because I don't have any samples. Now it builds and seems to work fine, but it doesn't build with the current libav version in sid, so I can wait until libav10 is available and bump the build-dependency to = 6:10~. Maybe you can upload a libv10 compatible version to experimental? Once the libav10 transition starts this version only need to be rebuilt. (The same has been done for other packages like mplayer2) http://packages.qa.debian.org/m/mplayer2/news/20140309T010408Z.html Cheers, Moritz -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#739243: FTBFS with libav10
On Mon, 3 Mar 2014 14:54:51 +0100, Alberto Garcia be...@igalia.com wrote: On Fri, Feb 28, 2014 at 11:28:20PM +0100, an...@khirnov.net wrote: the attached patch should fix this bug. Thanks for the patch! but it doesn't seem to work: libtool: link: gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -Wl,-z -Wl,relro -o fmfconv fmfconv.o fmfconv_ff.o fmfconv_yuv.o fmfconv_scr.o fmfconv_ppm.o fmfconv_wav.o fmfconv_au.o fmfconv_aiff.o -L/usr/lib -lavformat -lavcodec -lswscale -lavresample -lavutil compat/unix/libcompatos.a -lz -lgcrypt fmfconv_ff.o: In function `ffmpeg_add_sound_ffmpeg': /tmp/fuse-emulator-utils-1.1.1/fmfconv_ff.c:350: undefined reference to `avcodec_encode_audio' /tmp/fuse-emulator-utils-1.1.1/fmfconv_ff.c:375: undefined reference to `avcodec_encode_audio' collect2: error: ld returned 1 exit status Sorry, missed a hunk. Now it should compile; sadly I cannot test it because I don't have any samples. -- Anton KhirnovIndex: fuse-emulator-utils-1.1.1/fmfconv_ff.c === --- fuse-emulator-utils-1.1.1.orig/fmfconv_ff.c 2013-05-16 20:32:13.0 + +++ fuse-emulator-utils-1.1.1/fmfconv_ff.c 2014-03-06 08:49:05.542084378 + @@ -60,6 +60,8 @@ #include libavformat/avformat.h #include libavutil/mathematics.h +#include libavutil/opt.h +#include libavresample/avresample.h #include libswscale/swscale.h #include libspectrum.h @@ -94,9 +96,10 @@ static int audio_inpbuf_len; /* actual number of audio frames */ static AVFrame *ff_picture, *ff_tmp_picture, *ffmpeg_pict; +static AVFrame *audio_frame; static struct SwsContext *video_resize_ctx; -static ReSampleContext *audio_resample_ctx; +static AVAudioResampleContext *audio_resample_ctx; static int16_t **ffmpeg_sound; static uint8_t *video_outbuf; @@ -130,11 +133,10 @@ int ffmpeg_resample_audio( void ) { - int len; + int len, ret; if( audio_resample_ctx res_rte != snd_rte ) { -audio_resample_close( audio_resample_ctx ); -audio_resample_ctx = NULL; +avresample_free( audio_resample_ctx ); av_free( audio_tmp_inpbuf ); ffmpeg_sound = sound16; printi( 2, ffmpeg_resample_audio(): reinit resample %dHz - %dHz\n, snd_rte, out_rte ); @@ -145,11 +147,20 @@ out_fsz = 2 * out_chn; } if( !audio_resample_ctx ) { -audio_resample_ctx = av_audio_resample_init( out_chn, snd_chn, - out_rte, snd_rte, - AV_SAMPLE_FMT_S16, - AV_SAMPLE_FMT_S16, - 16, 8, 1, 1.0 ); +audio_resample_ctx = avresample_alloc_context(); +av_opt_set_int(audio_resample_ctx, in_channel_layout, av_get_default_channel_layout(snd_chn), 0); +av_opt_set_int(audio_resample_ctx, out_channel_layout, av_get_default_channel_layout(out_chn), 0); +av_opt_set_int(audio_resample_ctx, in_sample_fmt, AV_SAMPLE_FMT_S16, 0); +av_opt_set_int(audio_resample_ctx, out_sample_fmt, AV_SAMPLE_FMT_S16, 0); +av_opt_set_int(audio_resample_ctx, in_sample_rate, snd_rte, 0); +av_opt_set_int(audio_resample_ctx, out_sample_rate,out_rte, 0); + +ret = avresample_open(audio_resample_ctx); +if (ret 0) { +printe( Error opening the resample context\n); +return 1; +} + audio_tmp_inpbuf_size = (float)audio_outbuf_size * out_rte / snd_rte * (float)out_chn / snd_chn + 1.0; audio_tmp_inpbuf = av_malloc( audio_tmp_inpbuf_size ); ffmpeg_sound = (void *)(audio_tmp_inpbuf); @@ -160,9 +171,9 @@ return 1; } - len = audio_resample( audio_resample_ctx, - (short *)audio_tmp_inpbuf, (short *)sound16, - snd_len / snd_fsz ); + len = avresample_convert( audio_resample_ctx, + (uint8_t**)audio_tmp_inpbuf, audio_tmp_inpbuf_size, audio_tmp_inpbuf_size / out_fsz, + (uint8_t**)sound16, snd_len, snd_len / snd_fsz ); if( !len ) { printe( FFMPEG: Error during audio resampling\n ); return 1; @@ -224,7 +235,7 @@ */ static int -add_audio_stream( enum CodecID codec_id, int freq, int stereo ) +add_audio_stream( enum AVCodecID codec_id, int freq, int stereo ) { AVCodecContext *c; @@ -295,6 +306,8 @@ #endif audio_input_frames = c-frame_size; + audio_frame = av_frame_alloc(); + if( audio_input_frames = 1 ) { audio_outbuf_size = out_rte * 1250 * audio_oframe_size / out_fps; } else { @@ -336,20 +349,25 @@ if( audio_input_frames 1 ) { while( audio_inpbuf_len + len = audio_input_frames ) { int copy_len = ( audio_input_frames - audio_inpbuf_len ) * audio_iframe_size; - AVPacket pkt; - av_init_packet( pkt ); + AVPacket pkt = { 0 }; + int ret, got_output; memcpy( (char *)audio_inpbuf + ( audio_inpbuf_len * audio_iframe_size ), buf, copy_len ); len -= audio_input_frames - audio_inpbuf_len; buf =
Bug#739243: FTBFS with libav10
On Thu, Mar 06, 2014 at 09:54:25AM +0100, Anton Khirnov wrote: Now it should compile; sadly I cannot test it because I don't have any samples. Now it builds and seems to work fine, but it doesn't build with the current libav version in sid, so I can wait until libav10 is available and bump the build-dependency to = 6:10~. Berto -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#739243: FTBFS with libav10
On Fri, Feb 28, 2014 at 11:28:20PM +0100, an...@khirnov.net wrote: the attached patch should fix this bug. Thanks for the patch! but it doesn't seem to work: libtool: link: gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wall -Wl,-z -Wl,relro -o fmfconv fmfconv.o fmfconv_ff.o fmfconv_yuv.o fmfconv_scr.o fmfconv_ppm.o fmfconv_wav.o fmfconv_au.o fmfconv_aiff.o -L/usr/lib -lavformat -lavcodec -lswscale -lavresample -lavutil compat/unix/libcompatos.a -lz -lgcrypt fmfconv_ff.o: In function `ffmpeg_add_sound_ffmpeg': /tmp/fuse-emulator-utils-1.1.1/fmfconv_ff.c:350: undefined reference to `avcodec_encode_audio' /tmp/fuse-emulator-utils-1.1.1/fmfconv_ff.c:375: undefined reference to `avcodec_encode_audio' collect2: error: ld returned 1 exit status Berto -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#739243: FTBFS with libav10
Hi, the attached patch should fix this bug. Note that the package now depends on libavresample. -- Anton KhirnovIndex: fuse-emulator-utils-1.1.1/fmfconv_ff.c === --- fuse-emulator-utils-1.1.1.orig/fmfconv_ff.c 2013-05-16 20:32:13.0 + +++ fuse-emulator-utils-1.1.1/fmfconv_ff.c 2014-02-28 22:21:18.241002407 + @@ -60,6 +60,8 @@ #include libavformat/avformat.h #include libavutil/mathematics.h +#include libavutil/opt.h +#include libavresample/avresample.h #include libswscale/swscale.h #include libspectrum.h @@ -96,7 +98,7 @@ static AVFrame *ff_picture, *ff_tmp_picture, *ffmpeg_pict; static struct SwsContext *video_resize_ctx; -static ReSampleContext *audio_resample_ctx; +static AVAudioResampleContext *audio_resample_ctx; static int16_t **ffmpeg_sound; static uint8_t *video_outbuf; @@ -133,8 +135,7 @@ int len; if( audio_resample_ctx res_rte != snd_rte ) { -audio_resample_close( audio_resample_ctx ); -audio_resample_ctx = NULL; +avresample_free( audio_resample_ctx ); av_free( audio_tmp_inpbuf ); ffmpeg_sound = sound16; printi( 2, ffmpeg_resample_audio(): reinit resample %dHz - %dHz\n, snd_rte, out_rte ); @@ -145,11 +146,14 @@ out_fsz = 2 * out_chn; } if( !audio_resample_ctx ) { -audio_resample_ctx = av_audio_resample_init( out_chn, snd_chn, - out_rte, snd_rte, - AV_SAMPLE_FMT_S16, - AV_SAMPLE_FMT_S16, - 16, 8, 1, 1.0 ); +audio_resample_ctx = avresample_alloc_context(); +av_opt_set_int(audio_resample_ctx, in_channel_layout, av_get_default_channel_layout(snd_chn), 0); +av_opt_set_int(audio_resample_ctx, out_channel_layout, av_get_default_channel_layout(out_chn), 0); +av_opt_set_int(audio_resample_ctx, in_sample_fmt, AV_SAMPLE_FMT_S16, 0); +av_opt_set_int(audio_resample_ctx, out_sample_fmt, AV_SAMPLE_FMT_S16, 0); +av_opt_set_int(audio_resample_ctx, in_sample_rate, snd_rte, 0); +av_opt_set_int(audio_resample_ctx, out_sample_rate,out_rte, 0); + audio_tmp_inpbuf_size = (float)audio_outbuf_size * out_rte / snd_rte * (float)out_chn / snd_chn + 1.0; audio_tmp_inpbuf = av_malloc( audio_tmp_inpbuf_size ); ffmpeg_sound = (void *)(audio_tmp_inpbuf); @@ -160,9 +164,9 @@ return 1; } - len = audio_resample( audio_resample_ctx, - (short *)audio_tmp_inpbuf, (short *)sound16, - snd_len / snd_fsz ); + len = avresample_convert( audio_resample_ctx, + (uint8_t**)audio_tmp_inpbuf, audio_tmp_inpbuf_size, audio_tmp_inpbuf_size / out_fsz, + (uint8_t**)sound16, snd_len, snd_len / snd_fsz ); if( !len ) { printe( FFMPEG: Error during audio resampling\n ); return 1; @@ -224,7 +228,7 @@ */ static int -add_audio_stream( enum CodecID codec_id, int freq, int stereo ) +add_audio_stream( enum AVCodecID codec_id, int freq, int stereo ) { AVCodecContext *c; @@ -440,7 +444,7 @@ /* add a video output stream */ static int -add_video_stream( enum CodecID codec_id, int w, int h, int timing ) +add_video_stream( enum AVCodecID codec_id, int w, int h, int timing ) { AVCodecContext *c; @@ -599,7 +603,7 @@ void ffmpeg_add_frame_ffmpeg( void ) { - int out_size, ret; + int got_output, ret; AVCodecContext *c; if( !video_st ) return; @@ -619,22 +623,17 @@ ret = av_interleaved_write_frame( oc, pkt ); } else { +AVPacket pkt = { 0 }; + ffmpeg_pict-pts = c-frame_number; /* encode the image */ -out_size = avcodec_encode_video( c, video_outbuf, video_outbuf_size, ffmpeg_pict ); -/* if zero size, it means the image was buffered */ -if( out_size 0 ) { - AVPacket pkt; - av_init_packet( pkt ); +ret = avcodec_encode_video2(c, pkt, ffmpeg_pict, got_output); +if( ret = 0 got_output) { + pkt.pts = av_rescale_q( pkt.pts, c-time_base, video_st-time_base ); + pkt.dts = av_rescale_q( pkt.dts, c-time_base, video_st-time_base ); - if( c-coded_frame-pts != AV_NOPTS_VALUE ) -pkt.pts = av_rescale_q( c-coded_frame-pts, c-time_base, video_st-time_base ); - if( c-coded_frame-key_frame ) -pkt.flags |= AV_PKT_FLAG_KEY; pkt.stream_index= video_st-index; - pkt.data = video_outbuf; - pkt.size = out_size; /* write the compressed frame in the media file */ ret = av_interleaved_write_frame( oc, pkt ); @@ -674,7 +673,7 @@ { AVCodec *ac, *vc; - enum CodecID acodec, vcodec; + enum AVCodecID acodec, vcodec; ff_picture = NULL; ff_tmp_picture = NULL; @@ -725,7 +724,7 @@ vcodec = fmt-video_codec; acodec = fmt-audio_codec; - if( out_t == TYPE_FFMPEG vcodec != CODEC_ID_NONE ) { + if( out_t == TYPE_FFMPEG vcodec != AV_CODEC_ID_NONE ) { /* Find the video encoder requested by user
Bug#739243: FTBFS with libav10
On Mon, Feb 17, 2014 at 12:30:36AM +0100, Moritz Muehlenhoff wrote: your package fails to build from source against libav 10 (currently packaged in experimental). I took a quick look and the latest upstream snapshot seems to fail as well, likely because they seem to be using ffmpeg instead. I'll see what I can do. Worst case I'll just rebuild without ffmpeg support. Berto -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#739243: FTBFS with libav10
Package: fuse-emulator-utils Severity: important Hi, your package fails to build from source against libav 10 (currently packaged in experimental). This bug will become release-critical at some point when the libav10 transition starts. Migration documentation can be found at https://wiki.libav.org/Migration/10 Cheers, Moritz fmfconv_ff.c: In function 'ffmpeg_resample_audio': fmfconv_ff.c:136:5: warning: implicit declaration of function 'audio_resample_close' [-Wimplicit-function-declaration] audio_resample_close( audio_resample_ctx ); ^ fmfconv_ff.c:148:5: warning: implicit declaration of function 'av_audio_resample_init' [-Wimplicit-function-declaration] audio_resample_ctx = av_audio_resample_init( out_chn, snd_chn, ^ fmfconv_ff.c:148:24: warning: assignment makes pointer from integer without a cast [enabled by default] audio_resample_ctx = av_audio_resample_init( out_chn, snd_chn, ^ fmfconv_ff.c:163:3: warning: implicit declaration of function 'audio_resample' [-Wimplicit-function-declaration] len = audio_resample( audio_resample_ctx, ^ fmfconv_ff.c: At top level: fmfconv_ff.c:227:24: warning: 'enum CodecID' declared inside parameter list [enabled by default] add_audio_stream( enum CodecID codec_id, int freq, int stereo ) ^ fmfconv_ff.c:227:24: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] fmfconv_ff.c:227:32: error: parameter 1 ('codec_id') has incomplete type add_audio_stream( enum CodecID codec_id, int freq, int stereo ) ^ fmfconv_ff.c: In function 'ffmpeg_add_sound_ffmpeg': fmfconv_ff.c:346:7: warning: implicit declaration of function 'avcodec_encode_audio' [-Wimplicit-function-declaration] pkt.size = avcodec_encode_audio( c, audio_outbuf, audio_outbuf_size, audio_inpbuf ); ^ fmfconv_ff.c: At top level: fmfconv_ff.c:443:24: warning: 'enum CodecID' declared inside parameter list [enabled by default] add_video_stream( enum CodecID codec_id, int w, int h, int timing ) fmfconv_ff.c: In function 'alloc_picture': fmfconv_ff.c:508:3: warning: 'avcodec_alloc_frame' is deprecated (declared at /usr/include/libavcodec/avcodec.h:3110) [-Wdeprecated-declarations] picture = avcodec_alloc_frame(); ^ fmfconv_ff.c: In function 'ffmpeg_add_frame_ffmpeg': fmfconv_ff.c:625:5: warning: implicit declaration of function 'avcodec_encode_video' [-Wimplicit-function-declaration] out_size = avcodec_encode_video( c, video_outbuf, video_outbuf_size, ffmpeg_pict ); ^ fmfconv_ff.c: In function 'out_write_ffmpegheader': fmfconv_ff.c:677:16: error: storage size of 'acodec' isn't known enum CodecID acodec, vcodec; ^ fmfconv_ff.c:677:24: error: storage size of 'vcodec' isn't known enum CodecID acodec, vcodec; ^ fmfconv_ff.c:728:41: error: 'CODEC_ID_NONE' undeclared (first use in this function) if( out_t == TYPE_FFMPEG vcodec != CODEC_ID_NONE ) { ^ fmfconv_ff.c:728:41: note: each undeclared identifier is reported only once for each function it appears in fmfconv_ff.c:677:24: warning: unused variable 'vcodec' [-Wunused-variable] enum CodecID acodec, vcodec; ^ fmfconv_ff.c:677:16: warning: unused variable 'acodec' [-Wunused-variable] enum CodecID acodec, vcodec; ^ make[3]: *** [fmfconv_ff.o] Error 1 make[3]: Leaving directory `/home/jmm/av10/fuse-emulator-utils-1.1.1' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/jmm/av10/fuse-emulator-utils-1.1.1' make[1]: *** [all] Error 2 make[1]: Leaving directory `/home/jmm/av10/fuse-emulator-utils-1.1.1' dh_auto_build: make -j1 returned exit code 2 make: *** [build] Error 2 dpkg-buildpackage: error: debian/rules build gave error exit status 2 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org