Hi, attached are some changes to ffmpeg2raw. I'm not sure that I got to a level where I can verify that ffmpeg2raw works corrctly, though.
Kind regards T. -- Thomas Viehmann, http://thomas.viehmann.net/
diff -u smilutils-0.3.2+cvs20070731/debian/changelog smilutils-0.3.2+cvs20070731/debian/changelog --- smilutils-0.3.2+cvs20070731/debian/changelog +++ smilutils-0.3.2+cvs20070731/debian/changelog @@ -1,3 +1,18 @@ +smilutils (0.3.2+cvs20070731-4.1) unstable; urgency=low + + * Non-maintainer upload. + * Move off removed ffmpeg functions: + - avcodec_audio_decode -> avcodec_audio_decode2 + - img_convert -> sws_scale (with tedium of context acquisiton etc.) + - add libswscale-dev to build-depends + Closes: #517465, #487645. + * Fix the not completely ideal pointer usage in ffmpeg2raw that + caused some compiler warnings and also impeded testing because + ffmpeg2raw invariably printed "No video or audio stream found" + instead of actually doing something. + + -- Thomas Viehmann <t...@beamnet.de> Sat, 07 Mar 2009 21:04:05 +0100 + smilutils (0.3.2+cvs20070731-4) unstable; urgency=low * Fix build with gcc 4.3 (closes: #455132) diff -u smilutils-0.3.2+cvs20070731/debian/control smilutils-0.3.2+cvs20070731/debian/control --- smilutils-0.3.2+cvs20070731/debian/control +++ smilutils-0.3.2+cvs20070731/debian/control @@ -4,7 +4,7 @@ Maintainer: Roland Mas <lola...@debian.org> Uploaders: Paul Brossier <p...@debian.org> Standards-Version: 3.7.3 -Build-Depends: debhelper (>= 5), libquicktime-dev, libdv4-dev, libglib2.0-dev, libxml2-dev, libimlib2-dev, libsdl1.2-dev, autotools-dev, libltdl3-dev, ffmpeg, libavcodec-dev, libavformat-dev, libtool, libvorbis-dev, libogg-dev, libdts-dev, libgtk2.0-dev, autoconf, automake +Build-Depends: debhelper (>= 5), libquicktime-dev, libswscale-dev, libdv4-dev, libglib2.0-dev, libxml2-dev, libimlib2-dev, libsdl1.2-dev, autotools-dev, libltdl3-dev, ffmpeg, libavcodec-dev, libavformat-dev, libtool, libvorbis-dev, libogg-dev, libdts-dev, libgtk2.0-dev, autoconf, automake Package: smilutils Architecture: any diff -u smilutils-0.3.2+cvs20070731/config.sub smilutils-0.3.2+cvs20070731/config.sub --- smilutils-0.3.2+cvs20070731/config.sub +++ smilutils-0.3.2+cvs20070731/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-06-28' +timestamp='2008-01-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -72,8 +72,8 @@ version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -369,10 +369,14 @@ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ + | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -443,6 +447,14 @@ basic_machine=ns32k-sequent os=-dynix ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; c90) basic_machine=c90-cray os=-unicos @@ -668,6 +680,14 @@ basic_machine=m68k-isi os=-sysv ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; m88k-omron*) basic_machine=m88k-omron ;; @@ -813,6 +833,14 @@ basic_machine=i860-intel os=-osf ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; pbd) basic_machine=sparc-tti ;; @@ -1021,6 +1049,10 @@ basic_machine=tic6x-unknown os=-coff ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; tx39) basic_machine=mipstx39-unknown ;; diff -u smilutils-0.3.2+cvs20070731/config.guess smilutils-0.3.2+cvs20070731/config.guess --- smilutils-0.3.2+cvs20070731/config.guess +++ smilutils-0.3.2+cvs20070731/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-07-22' +timestamp='2008-01-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -56,8 +56,8 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -532,7 +532,7 @@ echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[45]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -799,6 +799,9 @@ EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks @@ -833,7 +836,14 @@ echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -954,8 +964,8 @@ x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-gnu + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -1474,9 +1484,9 @@ the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be diff -u smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/Makefile.am smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/Makefile.am --- smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/Makefile.am +++ smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/Makefile.am @@ -11,7 +11,7 @@ -D_FILE_OFFSET_BITS=64 AM_LDFLAGS = -rdynamic -L$(FFMPEG_PATH)/libavformat -lavformat -L$(FFMPEG_PATH)/libavcodec -lavcodec \ - $(FFMPEGLIBS) -lm -lz -ldl -ldv + $(FFMPEGLIBS) -lm -lz -ldl -ldv -lswscale endif only in patch2: unchanged: --- smilutils-0.3.2+cvs20070731.orig/apps/ffmpeg2raw/ffmpeg2raw.c +++ smilutils-0.3.2+cvs20070731/apps/ffmpeg2raw/ffmpeg2raw.c @@ -23,8 +23,9 @@ #include <sys/wait.h> #include <string.h> -#include <ffmpeg/common.h> -#include <ffmpeg/avformat.h> +#include <libavutil/common.h> +#include <libavformat/avformat.h> +#include <libswscale/swscale.h> #include "dvutils.h" @@ -132,11 +133,12 @@ AVCodec *acodec = NULL; AVCodec *vcodec = NULL; ReSampleContext *resample = NULL; + struct SwsContext *sws = NULL; double fps = 0.0; for( i = 0; i < this->context->nb_streams; i++ ) { - AVCodecContext *enc = &this->context->streams[ i ]->codec; + AVCodecContext *enc = this->context->streams[ i ]->codec; switch( enc->codec_type ) { case CODEC_TYPE_VIDEO: @@ -155,8 +157,9 @@ if ( this->video_index >= 0 ) { vstream = this->context->streams[ this->video_index ]; - venc = &this->context->streams[ this->video_index ]->codec; + venc = this->context->streams[ this->video_index ]->codec; vcodec = avcodec_find_decoder( venc->codec_id ); + printf("%p\n", vcodec); fps = (double) venc->time_base.den / (double) venc->time_base.num; if ( fps > 10000 ) fps /= 1000; if ( vcodec == NULL || avcodec_open( venc, vcodec ) < 0 ) @@ -168,7 +171,7 @@ if ( this->audio_index >= 0 ) { astream = this->context->streams[ this->audio_index ]; - aenc = &this->context->streams[ this->audio_index ]->codec; + aenc = this->context->streams[ this->audio_index ]->codec; acodec = avcodec_find_decoder( aenc->codec_id ); if ( this->channels != aenc->channels && aenc->codec_id == CODEC_ID_AC3) aenc->channels = this->channels; @@ -212,6 +215,10 @@ info.width = venc->width; info.height = venc->height; + + sws = sws_getContext( venc->width, venc->height, venc->pix_fmt, venc->width, venc->height, + PIX_FMT_RGB24, SWS_FAST_BILINEAR, NULL, NULL, NULL ); + dvframes_init( info, multiplier ); do @@ -235,7 +242,7 @@ while ( len > 0 ) { - len1 = avcodec_decode_video( &vstream->codec, frame, &got_picture, ptr, len); + len1 = avcodec_decode_video( vstream->codec, frame, &got_picture, ptr, len); if ( len1 < 0 ) break; if ( got_picture ) @@ -244,8 +251,9 @@ //if ( video_pts > 0 ) //fprintf( stderr, "video_pts = %f\n", video_pts ); - img_convert((AVPicture *)output, PIX_FMT_RGB24, (AVPicture *)frame, - venc->pix_fmt, venc->width, venc->height); + sws_scale( sws, ((AVPicture*)frame)->data, ((AVPicture*)frame)->linesize, + 0, venc->height, + ((AVPicture*)output)->data, ((AVPicture*)output)->linesize ); first = 0; @@ -266,7 +274,8 @@ while ( len > 0 ) { - len1 = avcodec_decode_audio(&astream->codec, audio_buf, &data_size, ptr, len ); + data_size = sizeof(audio_buf); + len1 = avcodec_decode_audio2(astream->codec, audio_buf, &data_size, ptr, len ); len -= len1; ptr += len1; if ( data_size > 0 ) @@ -292,6 +301,7 @@ } while ( ret >= 0 ); + sws_freeContext( sws ); dvframes_close( ); } else @@ -340,7 +350,7 @@ for(i=0;i<ic->nb_streams;i++) { AVStream *st = ic->streams[i]; - AVCodecContext *enc = &st->codec; + AVCodecContext *enc = st->codec; AVCodec *p = avcodec_find_decoder(enc->codec_id); if ( p ) printf("%c%d: %s\n", enc->codec_type == CODEC_TYPE_VIDEO ? 'V' : 'A', i, p->name );