Bug 101110

Summary: Cannot create MPEG from photos using transitions
Product: [Applications] digikam Reporter: Davide Ferrari <vide80>
Component: Plugin-Generic-VideoSlideshowAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: mail, ntung, rolandwolters, werner
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 5.7.0
Sentry Crash Report:
Attachments: patch

Description Davide Ferrari 2005-03-08 16:38:26 UTC
Version:           0.1.1 (using KDE 3.4.0, Gentoo)
Compiler:          gcc version 3.3.5 (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3, pie-8.7.7.1)
OS:                Linux (i686) release 2.6.10-gentoo-r6

No matter which version of mjpegtools I use, I always get the same error when trying to create an MPEG from a bunch of JPEG photos.

images2mpg --with-gui  -f VCD -n PAL -d 10 -t 2 -c 566c9d -T /tmp/kde-vide/kipi-mpegencoderplugin-6239/ -M /usr/bin -I /usr/bin -o /home/vide/output2.mpg -i  /home/path/to/photos.jpg /home/path/to/photos2.jpg
-----------------------------------------------
Initialising...

Encoding image files...

Images encoding (%) : 0      [0      
   INFO: [yuvscaler] yuvscaler 1.6.2 (31-12-2003) is a general scaling utility for yuv frames
   INFO: [yuvscaler] (C) 2001-2003 Xavier Biquard <xbiquard@free.fr>, yuvscaler -h for help, or man yuvscaler
**ERROR: [ppmtoy4m] Expecting maxval == 255, not 65535!
Comment 1 Davide Ferrari 2005-03-08 16:38:58 UTC
Oh, I forgot: without transtions no problem at all, it works smoothly!
Comment 2 Florian Ehrenthal 2005-03-23 19:14:52 UTC
same here
i am also running gentoo, maybe only a gentoo problem?
Comment 3 Davide Ferrari 2005-03-23 19:27:13 UTC
Maybe I'll give a try with kubuntu (but first I have to install it)..in the meanwhile if someone with another distro could tell us...:)
Comment 4 Al Bogner 2005-03-30 14:07:07 UTC
I noticed this problem too, without transitions it works, Also I noticed soundproblems during the change of the picture with a lot of mediaplayers, like xine and kaffeine, but the sound is fine with mplayer

Fedora Core3
uname -r
2.6.10-1.770_FC3

kipi-plugins-0.1-0.fdr.0.3.beta1.3
kdemultimedia-3.4.0-1.2.3.kde
Comment 5 Thorsten Schnebeck 2005-04-23 18:05:25 UTC
Thanks to bablefish I could understand:
http://www.guakeland.net/archives/12_Creacion+de+SVCD+a+partir+de+JPGs.html

[cite]
ERROR: [ ppmtoy4m ] maxval Expecting == 255, not 65535! **
ERROR: [ to yuvscaler ] Could'nt read YUV4MPEG to header! 
** ERROR: [ mpegènc ] Could not read YUV4MPEG2 to header:
system error (failed read/write)! ../img2vcd-0.4: 
line 197: 3096 broken Pipe cat $TEMPFILE../img2vcd-0.4: 
line 197: 3096 broken Pipe cat $TEMPFILE../img2vcd-0.4: 
line 197: 3096 broken Pipe cat $TEMPFILE../img2vcd-0.4: 
line 197: 3096 broken Pipe cat $TEMPFILE../img2vcd-0.4: 
line 197: 3096 broken Pipe cat $TEMPFILE...

Sera excrement... that? uhm... ** ERROR: [ ppmtoy4m ] maxval Expecting == 255, not 65535. Osea that the error this when creating flow YUV4MPEG2. Playing with ppmtoy4m I see that the problem has to do with the colors. The image that arrives to him at ppmtoy4m uses 16 bits of color instead of the 8 that the delay. We are going to analyze the code.
 
The place where the image is created that goes to him to ppmtoy4m (supposing that effect in the transition is not used) is: 
montage $memoryusage +label - shadow +frame - background 
white - geometry $geom "# " - # depth 8 ppm:$TEMPFILE

uhm... that rare... if depth 8 has the option -.... cagonto. To great the evils great remedies, despues to prove that convert works well, we added this line after the previous one (line 199): 
convert - depth 8 $TEMPFILE $TEMPFILE
[/cite]

So in case of kipiplugin we have to patch images2mpg.

Bye

  Thorsten


--- /usr/kde/3.4/bin/images2mpg.vanilla 2005-04-23 16:38:27.000000000 +0200
+++ /usr/kde/3.4/bin/images2mpg 2005-04-23 17:49:59.000000000 +0200
@@ -816,7 +816,7 @@
         fi

        # MjpegTools MPEG encoding with the number of frames and the current image.
-        cat "$TMPFILENAME.tmp.pnm"
+        $CONVERT_BIN -depth 8  "$TMPFILENAME.tmp.pnm" -

      done | $PPMTOY4M_BIN -v $VERBOSE -n $NBFRAMETOTAL -F $IMAGES_SEC_FORMAT | $YUVSCALER_BIN -v $VERBOSE -n $VIDEO_TYPE_LETTER -O $VIDEO_FORMAT | $MPEG2ENC_BIN -v $VERBOSE -n $VIDEO_TYPE_LETTER -b $BIT_RATE -V $BUFFER_SIZE -f $VIDEO_FORMAT_NUMBER -o "$TMPFILENAME.tmp.m2v"
Comment 6 Thorsten Schnebeck 2005-04-23 18:06:59 UTC
Created attachment 10765 [details]
patch
Comment 7 caulier.gilles 2005-04-24 17:57:50 UTC
CVS commit by cgilles: 

Patch from Thorsten Schnebeck <thorsten.schnebeck@gmx.net>
Please try again with this patch applied to CVS HEAD. 
In according with results please close this bug.
CCBUG:101110
CCMAIL: digikam-deve@lists.sourceforge.net


  M +23 -10    images2mpg   1.3
  M +8 -8      kimg2mpg.cpp   1.33
Comment 8 Roland Wolters 2005-07-22 00:27:00 UTC
So what's the actual state of this bug? Is it fixed? If yes, where? And what do I have to do?
Comment 9 Renchi Raju 2005-07-22 19:11:53 UTC
did you try the attached patch? if it works for you, then the bugreport can be closed
Comment 10 Roland Wolters 2005-07-22 23:47:09 UTC
At the moment I use a rpm-based package which do not contain these new cvs fixes. I need a short link how to get the cvs files, and prepare them for a ./configure && make && make install (which I can do for my own). Sorry, I am not very used to using cvs/subversion, and need a little help with that :/
Comment 12 Roland Wolters 2005-07-23 17:15:18 UTC
Thanks for the howto. I got the kipi-plugins sources, but I ran into make-errors:

$ make -f Makefile.cvs
[...]
*** Creating Makefile templates
kipi-plugins/Makefile.am:19: compile_LIBKEXIF does not appear in AM_CONDITIONAL
make[1]: *** [cvs] Fehler 1
make: *** [all] Fehler 2

All I did before was editing configure.in.in to avoid the VISIBILITY problem.
What to do now?
Comment 13 Tung NGUYEN 2005-08-15 13:27:37 UTC
I have compiled and tested the Kipi daily snapshot (ftp://ftp.kde.org/pub/kde/unstable/snapshots/kdeextragear-libs.tar.bz2) under MandrivaLinux and transition effects work fine. I think you can close the bug.
Comment 14 Roland Wolters 2005-09-03 21:25:31 UTC
I tested with a kde compiled from svn (kdesvn-build) and still run into errors:

Initialising...

Encoding image files...

Images encoding (%) : 0      [0      
   INFO: [yuvscaler] yuvscaler 1.6.3-rc3 (15-02-2004) is a general scaling
utility for yuv frames
   INFO: [yuvscaler] (C) 2001-2004 Xavier Biquard <xbiquard@free.fr>,
yuvscaler -h for help, or man yuvscaler
**ERROR: [yuvscaler] Could'nt read YUV4MPEG header!
-----------------------------------------------

EXIT STATUS : error during encoding process.

So I can't vote for closing this bug.
Comment 15 Neil Bothwick 2005-09-08 19:23:07 UTC
Applying the patch fixed the original error (incidentally, images2mpg is in /usr/bin in Gentoo). However, I now get a different error, at the end of the process.


THE COMMAND LINE IS :

images2mpg --with-gui  -f DVD -n PAL -d 5 -t 2 -c 000 -T /tmp/kde-nelz/kipi-mpegencoderplugin-13589/ -M /usr/bin -I /usr/bin -o /home/nelz/output.mpg -i  /mnt/av/digicam/albums/3way/img_5325.png  /mnt/av/digicam/albums/3way/img_5741a.jpg  /mnt/av/digicam/albums/3way/img_5326.png  /mnt/av/digicam/albums/3way/img_5784.png 
-----------------------------------------------
Initialising...

Encoding image files...

Images encoding (%) : 0      [0      
   INFO: [yuvscaler] yuvscaler 1.6.2 (31-12-2003) is a general scaling utility for yuv frames
   INFO: [yuvscaler] (C) 2001-2003 Xavier Biquard <xbiquard@free.fr>, yuvscaler -h for help, or man yuvscaler
Images encoding (%) : 0      [0      
Images encoding (%) : 0      [0      
[snip]
Images encoding (%) : 99      [4      
Images encoding (%) : 99      [4      
**ERROR: [ppmtoy4m] Bad Raw PPM magic!
-----------------------------------------------

EXIT STATUS : error during encoding process.

This is with version 0.7.4 on Athlon64 and PPC hardware. The m2v file is created in the temporary directory, I haven't tried adding sound.
Comment 16 Tung NGUYEN 2005-09-15 11:26:03 UTC
[Sorry, I forgot to CC my E-mail in the bug report]

For Roland Wolters:

The error message of your comment #14 ("**ERROR: [yuvscaler] Could'nt read YUV4MPEG header! ") is another different error.

Currently, there are 2 differents errors which prevents an user from creating MPEG slideshow:

1) Error: "**ERROR: [ppmtoy4m] Expecting maxval == 255, not 65535!" (creating MPEG slideshow with transition). This error is currently fixed in SVN (by Thorsten Schnebeck's patch provided in this bug report).

2) Error: "**ERROR: [yuvscaler] Could'nt read YUV4MPEG header!". This error comes from mjpegtools-1.6.3-rcX, the solution was found today by Anthony Tantillo in this bug report http://bugs.kde.org/show_bug.cgi?id=109739.

=> For your comment #14, I think the firts error is fixed and you have now the second error because you use mjpegtools 1.6.3-rc3.

For kde-imaging@kde.org: again, I think you can close this bug report because the original problem is resolved.
Comment 17 Tom Albers 2005-10-02 18:39:51 UTC
*** Bug 113722 has been marked as a duplicate of this bug. ***
Comment 18 werner 2005-10-02 19:37:56 UTC
ok,
comment #5 helped me with bug #113722.
although I still get:
**ERROR: [ppmtoy4m] Bad Raw PPM magic! 
when trying to set transition to something > 0 (same as comment #15).
Thanks.
Comment 19 Giovanni Venturi 2005-12-07 19:58:11 UTC
Cannot create a movie from a JPEG images sequence with Digikam 0.8 on a KDE 3.4.3 compiled from SVN:

LA RIGA DI COMANDO È:

images2mpg --with-gui  -f DVD -n PAL -d 3 -t 5 -c 000 -T /tmp/kde-slackyHjfZco/kipi-mpegencoderplugin-6548/ -M /usr/bin -I /usr/bin -w "/home/slacky/wav/Artista sconosciuto/Album sconosciuto 2/track02.cdda.wav" -o "/home/slacky/output.mpg" -i  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5049.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5051.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5063.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5064.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5065.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5066.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5067.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5068.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5069.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5070.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5101.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5102.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5103.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5104.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5105.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5106.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5108.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5110.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5111.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5112.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5113.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5114.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5116.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5118.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5120.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5121.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5122.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5124.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5125.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5127.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5128.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5130.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5132.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5186.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5187.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5188.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5189.JPG"  "/home/slacky/Immagini/Galleria/2005/11-Novembre2005/IMG_5190.JPG" 
-----------------------------------------------
Initialising...

Encoding image files...

Images encoding (%) : 0      [0      
   INFO: [yuvscaler] yuvscaler 1.8.0 (15-02-2004) is a general scaling utility for yuv frames
   INFO: [yuvscaler] (C) 2001-2004 Xavier Biquard <xbiquard@free.fr>, yuvscaler -h for help, or man yuvscaler
**ERROR: [yuvscaler] Could'nt read YUV4MPEG header!
-----------------------------------------------

STATO DI USCITA: errore durante il processo di codifica.
Comment 20 Tom Albers 2005-12-07 20:10:57 UTC
Giovanni, does the source you compiled contain Thorstens patch?
Comment 21 Giovanni Venturi 2005-12-07 20:24:00 UTC
I get it from SVN stable branch digikam.
Comment 22 Tom Albers 2005-12-07 21:00:35 UTC
we are talking about kipi here, not digikam. So where did you get the kipi-plugins from?
Comment 23 Tung NGUYEN 2005-12-07 21:27:00 UTC
Giovanni, 

You are on the wrong bug report. Your recurring problem is related here http://bugs.kde.org/show_bug.cgi?id=109739. 

Currently, if you want to create MPEG slideshow, you MUST USE mjpegtools-1.6.2 (no mjpegtools-1.6.3.rcXX, no mjpegtools-1.8.0... your mjpegtools version is 1.8.0 and it does not work).
Comment 24 Angelo Naselli 2005-12-07 21:50:49 UTC
Alle 21:00, mercoled
Comment 25 Giovanni Venturi 2005-12-07 21:57:08 UTC
lib-kipi from svn trunk.
Comment 26 Giovanni Venturi 2005-12-07 21:58:59 UTC
> mjpegtools-1.6.2 (no mjpegtools-1.6.3.rcXX, no mjpegtools-1.8.0... your
> mjpegtools version is 1.8.0 and it does not work).

And when do you think of fix this? lib-kipi 0.2?
Comment 27 Tom Albers 2005-12-13 19:07:46 UTC

*** This bug has been marked as a duplicate of 109739 ***
Comment 28 caulier.gilles 2017-06-30 07:09:48 UTC
digiKam has a new Video Slideshow tool based on QtAV and ffmpeg which do not
have this problem.

Gilles Caulier