Hi,

I've just successfully built dvbcut with current ffmpeg.
First of all, thanks a lot for the autoconf files!
Makes everything a bit easier.

> On Tue, 2008-10-21 at 08:18 +0200, Michael Riepe wrote:
> > Hi!
> > 
> > Mike wrote:
> > > Okay, I tried compling with 
> > > 
> > > ./configure --with-ffmpeg=/usr/local
> > > make
> > > 
> > > and I end up with this:
> > > 
> > > avframe.cpp:21:20: error: qimage.h: No such file or directory
> > 
> > You obviously also need --with-qt3=/wherever

This was not working for me, Debian has include files in
/usr/include/qt3, so I added QTDIR/include/qt3, see patch below.

> This is not the only problem. Further down you see 
> 
> > avframe.cpp:45: error: ‘img_copy’ was not declared in this scope
> 
> because newer ffmpeg has now av_picture_copy() instead, and also
> avcodec_decode_audio() does not exist anymore (it was superseded by
> avcodec2_decode_audio()).

IMHO, these are trivial to fix as you have found also.

> The only problem remaining: it does still not work then with the lavf
> muxer, complaining about an aspect ratio problem which I was unable to
> fix until now with my limited C(++) knowledge. Maybe Wolfram Gloger has
> a fix.

I think I have fixed this, see below.  With limited testing,
everything seems to work, no audio skips or anything..

Regards,
Wolfram.

diff -ur dvbcut/configure.in dvbcut-wg/configure.in
--- dvbcut/configure.in 2008-10-26 21:44:51.000000000 +0100
+++ dvbcut-wg/configure.in      2008-10-26 21:47:56.000000000 +0100
@@ -88,7 +88,7 @@
 AC_CHECK_LIB(mad, mad_decoder_init,
   [AC_DEFINE(HAVE_LIB_MAD, 1, [Define this if you have libmad.])
   LIBS="$LIBS -lmad"],
-  [AC_MSG_ERROR([Did not find required mad library])])
+  [AC_MSG_WARN([Did not find mad library])])
 AC_CHECK_LIB(a52, a52_init,
   [AC_DEFINE(HAVE_LIB_A52, 1, [Define this if you have liba52.])
   LIBS="$LIBS -la52"],
@@ -148,7 +148,7 @@
   esac])
 AC_SUBST(QTDIR)
 
-CPPFLAGS="$CPPFLAGS -I$QTDIR/include"
+CPPFLAGS="$CPPFLAGS -I$QTDIR/include/qt3 -I$QTDIR/include"
 LDFLAGS="$LDFLAGS -L$QTDIR/$mr_libdirname"
 
 AC_CHECK_LIB(qt-mt, main,
diff -ur dvbcut/src/avframe.h dvbcut-wg/src/avframe.h
--- dvbcut/src/avframe.h        2008-03-25 21:32:27.000000000 +0100
+++ dvbcut-wg/src/avframe.h     2008-10-26 21:47:56.000000000 +0100
@@ -43,6 +43,12 @@
 #ifdef HAVE_LIB_SWSCALE
   struct SwsContext *img_convert_ctx;
 #endif
+#if LIBAVCODEC_VERSION_INT >= (51 << 16)
+  void img_copy(AVPicture *dst, const AVPicture *src,
+               int pix_fmt, int width, int height) {
+    av_picture_copy(dst, src, pix_fmt, width, height);
+  }
+#endif
 
 public:
   avframe();
diff -ur dvbcut/src/lavfmuxer.cpp dvbcut-wg/src/lavfmuxer.cpp
--- dvbcut/src/lavfmuxer.cpp    2008-03-25 21:32:27.000000000 +0100
+++ dvbcut-wg/src/lavfmuxer.cpp 2008-10-26 22:58:57.000000000 +0100
@@ -59,6 +59,7 @@
   mpg.setvideoencodingparameters();
   s->codec=mpg.getavcc(VIDEOSTREAM);
   s->codec->rc_buffer_size = 224*1024*8;
+  s->sample_aspect_ratio = s->codec->sample_aspect_ratio;
 
   for (int i=0;i<mpg.getaudiostreams();++i)
     if (audiostreammask & (1u<<i)) {
@@ -86,11 +87,16 @@
        if (sd->getitemlistsize() > 1) {
          if (!avcodec_open(s->codec,
                            avcodec_find_decoder(s->codec->codec_id))) {
-           int16_t samples[6*1536]; // must be enough for 6 AC-3 channels --mr
+           int16_t samples[AVCODEC_MAX_AUDIO_FRAME_SIZE/sizeof(int16_t)];
            int frame_size=sizeof(samples);
            //fprintf(stderr, "** decode audio size=%d\n", sd->inbytes());
-           avcodec_decode_audio(s->codec,samples,&frame_size,
-                                (uint8_t*) sd->getdata(),sd->inbytes());
+#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0)
+           avcodec_decode_audio2
+#else
+           avcodec_decode_audio
+#endif
+             (s->codec,samples,&frame_size,
+              (uint8_t*) sd->getdata(),sd->inbytes());
            avcodec_close(s->codec);
          }
          break;



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
DVBCUT-user mailing list
DVBCUT-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dvbcut-user

Reply via email to