Bug 164442

Summary: manage videos just like photos [patch]
Product: [Applications] digikam Reporter: Olivier LAHAYE <olivier.lahaye1>
Component: Metadata-VideoAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: wishlist CC: ahuggel, caulier.gilles, dpac.mittal2, geow812, mail.abu.to, marcel.wiesweg, matt.muchowski, philippe.roubach, smit.meh, sreedharpalayil
Priority: NOR    
Version: 3.0.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 3.2.0
Attachments: Video Search mockup patch
Implement Video Advanced Search feature

Description Olivier LAHAYE 2008-06-19 12:04:07 UTC
Version:           0.10.0 (using KDE 4.0.80)
OS:                Linux

Manage videos like photos. Make video and photo library available to other softwares.
Example: in kdenlive, instead of having kdenlive manage its own video library, it could use a digikam plugin.
the plugin would allow to chose videos. Digikam would be used to manage the videos. That would centralize media management while simplifying other softwares.
Comment 1 caulier.gilles 2008-06-19 12:08:52 UTC
Olivier,

I'm not agree to make digiKam has video editing tool. this is not the goal.

Video support have been improved in KDE4 port of digiKam, in term of file management.

It still metadata management and search tool from video files to improve...

Gilles Caulier
Comment 2 Bram Schoenmakers 2008-09-08 22:18:06 UTC
*** Bug 170387 has been marked as a duplicate of this bug. ***
Comment 3 caulier.gilles 2008-12-05 20:07:27 UTC
Andreas,

Since a lots of digital camera provide movies capture, I thinks we need to study metadata support for mpg, avi, and mov files with Exiv2...

What do you think about ?

Gilles Caulier
Comment 4 Andreas Huggel 2008-12-09 13:21:37 UTC
Gilles,

If these video formats contain metadata and there is a need to access that, then yes, it is within the scope of Exiv2 to deal with it.
Technically, we need to have a unified metadata container before it is practical to introduce new types of metadata. That is one of the major features I plan for 0.19.

Andreas
Comment 5 caulier.gilles 2008-12-09 13:49:49 UTC
Andreas,

I don't think that AVI, MOC, MPG, and other main video format as exif info, but XMP is it:

RIFF based files (AVI) : http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/RIFF.html

QuickTime (MOV and MPEG4) : http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/QuickTime.html

DIVX (ASF) : http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/ASF.html

Gilles Caulier
Comment 6 Andreas Huggel 2008-12-09 14:32:48 UTC
Gilles,

Thanks for the links. Of course as long as the metadata is encoded in one of the already supported metadata formats - Exif, IPTC, XMP - then it's just a matter of writing a new Image class, using the existing parsers. Anyone can do it anytime.

Andreas
Comment 7 caulier.gilles 2009-07-20 11:18:34 UTC
Andreas,

Do you now if somebody work on video format support to Exiv2 ?

Gilles Caulier
Comment 8 Andreas Huggel 2009-07-20 12:05:04 UTC
Nobody as far as I know.

Andreas
Comment 9 caulier.gilles 2009-07-20 12:22:02 UTC
Hum... I really need this feature since i buy a new digital camera recorder:

http://www.trustedreviews.com/camcorders/review/2009/05/30/Sony-Handycam-HDR-CX105E/p1

Gilles
Comment 10 Philippe ROUBACH 2010-06-12 10:43:56 UTC
i agree with Olivier 

how to say that ?

i don't make video editing but more and more for an event i take
half photos and half movies (.mov)

it' not true movie but very short movie 30 s i called "snap movie"

i don't make any differences between the twos
i manage photos and movies the same way
Comment 11 caulier.gilles 2010-06-12 16:47:42 UTC
We have planed to talk about in coding sprint :

http://techbase.kde.org/Projects/Digikam/CodingSprint2010#Common_Topics_for_Discussion_and_Coding

Gilles Caulier
Comment 12 caulier.gilles 2011-12-13 09:25:04 UTC
*** Bug 227259 has been marked as a duplicate of this bug. ***
Comment 13 caulier.gilles 2011-12-17 09:34:48 UTC
Andreas,

Some news about video support in Exiv2 ? Do you have some found contributors about ?

Gilles Caulier
Comment 14 Deepak Mittal 2012-03-16 22:34:27 UTC
Is it necessary to modify Exiv2. Why don't we just use one of the several available XMP libraries for the file formats that Exiv2 don't support?
Comment 15 caulier.gilles 2012-03-16 22:53:18 UTC
because Exiv2 must be fixed to support video file, to be more universal.

A GSoC 2012 project have been open in this way...

Gilles Caulier
Comment 16 Andreas Huggel 2012-03-17 02:23:55 UTC
> Some news about video support in Exiv2 ? Do you have some found contributors
> about ?

Two have shown interest. I think I copied you on all the conversations so far. 

-ahu.
Comment 17 caulier.gilles 2012-07-10 06:20:15 UTC
Git commit 9c361bc4b3d4a625210c75aea67b66ab35ab7300 by Abhinav Badola.
Committed on 10/07/2012 at 08:04.
Pushed by badola into branch 'development/3.0.0'.

Added basic support for Video metadata, adding of records in database VideoMetadata

M  +40   -0    data/database/dbconfig.xml.cmake
M  +123  -0    libs/database/albumdb.cpp
M  +33   -0    libs/database/albumdb.h
M  +6    -3    libs/database/databasechangesets.cpp
M  +1    -0    libs/database/databasecopymanager.cpp
M  +30   -2    libs/database/databasefields.h
M  +21   -0    libs/database/databaseinfocontainers.h
M  +12   -0    libs/database/imageinfo.cpp
M  +2    -0    libs/database/imageinfo.h
M  +1    -0    libs/database/imagelister.cpp
M  +33   -0    libs/database/imagequerybuilder.cpp
M  +85   -3    libs/database/imagescanner.cpp
M  +1    -0    libs/database/imagescanner.h
M  +27   -0    libs/database/schemaupdater.cpp
M  +16   -0    libs/dmetadata/dmetadata.cpp
M  +9    -1    libs/dmetadata/metadatainfo.h
M  +2    -0    libs/imageproperties/imagepropertiessidebardb.cpp

http://commits.kde.org/digikam/9c361bc4b3d4a625210c75aea67b66ab35ab7300
Comment 18 Abhinav Badola 2012-07-24 21:02:48 UTC
Git commit 7ceb80ccd8ae4e7531afdb82197ca1754f9dd4ce by Abhinav Badola.
Committed on 24/07/2012 at 22:42.
Pushed by badola into branch 'development/3.0.0'.

Made all text entries in video metadata database

Changed all entries to text in datbase. Improved data reading functionality.

M  +6    -6    data/database/dbconfig.xml.cmake
M  +3    -3    libs/database/albumdb.h
M  +3    -3    libs/database/databaseinfocontainers.h
M  +3    -3    libs/database/imagequerybuilder.cpp
M  +5    -4    libs/dmetadata/metadatainfo.h

http://commits.kde.org/digikam/7ceb80ccd8ae4e7531afdb82197ca1754f9dd4ce
Comment 19 Abhinav Badola 2012-07-24 21:02:48 UTC
Git commit e9727d9d5048dfdd6280587c86991f2857abbacd by Abhinav Badola.
Committed on 24/07/2012 at 22:48.
Pushed by badola into branch 'development/3.0.0'.

Added support for Video metadata in Image Properties Sidebar

Though the entries are visible in the sidebar, the values are not being read properly. Needs revision.

M  +22   -0    libs/database/imageinfo.cpp
M  +2    -0    libs/database/imageinfo.h
M  +31   -12   libs/database/imagescanner.cpp
M  +6    -6    libs/database/schemaupdater.cpp
M  +55   -1    libs/dmetadata/dmetadata.cpp
M  +4    -0    libs/dmetadata/dmetadata.h
M  +81   -0    libs/dmetadata/photoinfocontainer.cpp
M  +29   -0    libs/dmetadata/photoinfocontainer.h
M  +13   -0    libs/imageproperties/imagepropertiessidebardb.cpp
M  +145  -1    libs/imageproperties/imagepropertiestab.cpp
M  +10   -0    libs/imageproperties/imagepropertiestab.h

http://commits.kde.org/digikam/e9727d9d5048dfdd6280587c86991f2857abbacd
Comment 20 Abhinav Badola 2012-07-24 21:14:40 UTC
I have made the entries in most of the files that had entries for Photograph Metadata as well.

But still the data is not being fetched properly. The data is being stored in the database VideoMetadata, but somehow it is not being fetched into VideoInfoContainer.

Can please anyone guide me where I may be going wrong..?
Comment 21 Abhinav Badola 2012-07-25 22:08:38 UTC
Git commit c37f212f7fc8e1668c2c227ddf5aa1cc02a5e1c2 by Abhinav Badola.
Committed on 25/07/2012 at 23:50.
Pushed by badola into branch 'development/3.0.0'.

Improved support for Video metadata in Image Properties Sidebar

Video Bit Depth Corrected. Entries are visible in the sidebar, the values are not being read properly. Needs revision.

M  +1    -0    digikam/utils/tooltipfiller.cpp
M  +1    -1    libs/database/imagescanner.cpp
M  +1    -0    libs/dimg/loaders/dimgloader.h
M  +116  -1    libs/imageproperties/cameraitempropertiestab.cpp
M  +15   -0    libs/imageproperties/imagepropertiessidebar.cpp
M  +16   -16   libs/imageproperties/imagepropertiestab.cpp
M  +51   -0    utilities/advancedrename/parser/options/database/keys/metadatakeys.cpp
M  +1    -0    utilities/qmlshow/qmlshow.h

http://commits.kde.org/digikam/c37f212f7fc8e1668c2c227ddf5aa1cc02a5e1c2
Comment 22 Abhinav Badola 2012-07-26 14:44:45 UTC
Git commit c3e65017cd8e7d034a5c445cfd5d4e8eedcfda75 by Abhinav Badola.
Committed on 26/07/2012 at 16:41.
Pushed by badola into branch 'development/3.0.0'.

Improved Dimensions of  Video metadata in Image Properties Sidebar

Video width, height added. ImagePropertiesSidebar is not fetching data. VideoInfo Container is not fetching data.

M  +2    -5    libs/database/imagescanner.cpp
M  +89   -7    libs/dialogs/imagedialog.cpp
M  +4    -1    libs/dmetadata/dmetadata.cpp
M  +3    -1    libs/dmetadata/metadatainfo.h
M  +1    -1    libs/imageproperties/imagepropertiessidebar.cpp
M  +1    -1    libs/imageproperties/imagepropertiessidebardb.cpp

http://commits.kde.org/digikam/c3e65017cd8e7d034a5c445cfd5d4e8eedcfda75
Comment 23 Abhinav Badola 2012-07-27 00:30:28 UTC
Git commit c8c086f7f53b3762284581c5fa02f7f2af5107a0 by Abhinav Badola.
Committed on 27/07/2012 at 02:29.
Pushed by badola into branch 'development/3.0.0'.

Enable Show/Hide for Display of  Video metadata in Image Properties Sidebar

Fixed dmetadata.cpp to fetch data for VideoInfo Container, from the database.

M  +1    -5    libs/database/imagescanner.cpp
M  +10   -1    libs/dmetadata/dmetadata.cpp
M  +2    -2    libs/imageproperties/imagepropertiestab.cpp

http://commits.kde.org/digikam/c8c086f7f53b3762284581c5fa02f7f2af5107a0
Comment 24 Abhinav Badola 2012-07-28 08:58:52 UTC
Git commit f42b504a5a83cab2b70c8183ef5888835640f1a8 by Abhinav Badola.
Committed on 28/07/2012 at 10:57.
Pushed by badola into branch 'development/3.0.0'.

Completed Tool Tip Display/Settings of  Video metadata

M  +123  -1    digikam/utils/albumsettings.cpp
M  +24   -0    digikam/utils/albumsettings.h
M  +104  -1    digikam/utils/tooltipfiller.cpp
M  +72   -1    utilities/setup/setuptooltip.cpp

http://commits.kde.org/digikam/f42b504a5a83cab2b70c8183ef5888835640f1a8
Comment 25 Abhinav Badola 2012-07-28 12:06:01 UTC
Git commit e025d7dd74215408cc7c6d9c23e88a412b0edba3 by Abhinav Badola.
Committed on 28/07/2012 at 14:03.
Pushed by badola into branch 'development/3.0.0'.

Removed Resolution field in Video metadata

M  +4    -6    data/database/dbconfig.xml.cmake
M  +0    -3    digikam/utils/albumsettings.h
M  +2    -7    libs/database/albumdb.cpp
M  +1    -2    libs/database/albumdb.h
M  +1    -3    libs/database/databasefields.h
M  +0    -1    libs/database/databaseinfocontainers.h
M  +0    -1    libs/database/imageinfo.cpp
M  +0    -4    libs/database/imagequerybuilder.cpp
M  +1    -3    libs/database/imagescanner.cpp
M  +1    -11   libs/dialogs/imagedialog.cpp
M  +0    -8    libs/dmetadata/dmetadata.cpp
M  +0    -1    libs/dmetadata/metadatainfo.h
M  +2    -7    libs/dmetadata/photoinfocontainer.cpp
M  +0    -1    libs/dmetadata/photoinfocontainer.h
M  +2    -12   libs/imageproperties/cameraitempropertiestab.cpp
M  +0    -1    libs/imageproperties/imagepropertiessidebar.cpp
M  +0    -1    libs/imageproperties/imagepropertiessidebardb.cpp
M  +2    -16   libs/imageproperties/imagepropertiestab.cpp
M  +0    -1    libs/imageproperties/imagepropertiestab.h
M  +0    -6    utilities/advancedrename/parser/options/database/keys/metadatakeys.cpp

http://commits.kde.org/digikam/e025d7dd74215408cc7c6d9c23e88a412b0edba3
Comment 26 caulier.gilles 2012-07-31 19:09:14 UTC
Abhinav,

In 3.0.0 branch, i polished all code relevant of Advanced Search tool. To close this entry, we need to implement video search feature.

Tomorow, i create a mockup for GUI to discut about the dialog implementation. In the background, search is performed through an XML interface to query the DB, coded by Marcel. It's very powerful and hack-able as well. I will list all the implementation relevant to patch about...

Gilles Caulier
Comment 27 Abhinav Badola 2012-07-31 21:06:03 UTC
Gilles,

Thanks, I will be looking forward to it.
Comment 28 Abhinav Badola 2012-08-01 19:59:07 UTC
Git commit e4def9e597b3e236b1a97309c8c0e177c57085e2 by Abhinav Badola.
Committed on 01/08/2012 at 21:57.
Pushed by badola into branch 'development/3.0.0'.

Updated DBSCHEMA.ODS, registered VideoMetadata table in it.

M  +-    --    project/documents/DBSCHEMA.ODS

http://commits.kde.org/digikam/e4def9e597b3e236b1a97309c8c0e177c57085e2
Comment 29 caulier.gilles 2012-08-02 11:49:39 UTC
Abhinav,

Can you reproduce :

digikam(8170)/digikam (core) Digikam::ImageScanner::addImage: Adding new item "/mnt/data/photos.test/Videos/2012-07-07_17.27.34.mp4"

(       32): ftyp      :
(  1214229): mdat      :Unprocessed
(    12880): moov      :(      108): mvhd      :
(    12154): trak      :
(       92): tkhd      :    Stream  |0|  
(    12054): mdia      :(       32): mdhd      :
(       37): hdlr      :
(    11977): minf      :(       20): vmhd      :
(       36): dinf      :(       28): dref      :(       12): url       :
(    11913): stbl      :(      117): stsd      :
(     7232): stts      :: 902
(      316): stsc      :Unprocessed
(     4016): stsz      :Unprocessed
(      204): stco      :Unprocessed
(       20): stss      :Unprocessed
(      610): trak      :
(       92): tkhd      :    Stream  |1|  
(      510): mdia      :(       32): mdhd      :
(       37): hdlr      :*** glibc detected *** /usr/bin/digikam: double free or corruption (!prev): 0xad355210 ***
======= Backtrace: =========
/lib/i686/libc.so.6(+0x6cbe2)[0xb49b5be2]
/usr/lib/libstdc++.so.6(_ZdlPv+0x1f)[0xb4bb9c7f]
/usr/lib/libstdc++.so.6(_ZdaPv+0x1b)[0xb4bb9cdb]
/usr/lib/libexiv2.so.12(_ZN5Exiv27DataBufD2Ev+0x28)[0xb381c64e]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo14handlerDecoderEm+0x686)[0xb38b85d0]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEm+0x254)[0xb38b57d8]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo11decodeBlockEv+0x177)[0xb38b555b]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo12readMetadataEv+0x3bd)[0xb38b52cd]
/usr/lib/libkexiv2.so.11(_ZNK11KExiv2Iface6KExiv24loadERK7QString+0x11c)[0xb7378c32]
/usr/lib/libdigikamcore.so.3(_ZNK7Digikam9DMetadata4loadERK7QString+0x37)[0xb6f11555]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam12ImageScanner12loadFromDiskEv+0x64)[0xb6afacec]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner11scanNewFileERK9QFileInfoi+0x86)[0xb6aa6008]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner9scanAlbumERKNS_18CollectionLocationERK7QString+0x610)[0xb6aa5516]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner9scanAlbumERKNS_18CollectionLocationERK7QString+0x7e4)[0xb6aa56ea]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner13scanAlbumRootERKNS_18CollectionLocationE+0x81)[0xb6aa4167]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner12completeScanEv+0x278)[0xb6aa2b56]
/usr/bin/digikam[0x81f7c6c]
/usr/lib/libQtCore.so.4(+0x67bf0)[0xb4df2bf0]
/lib/i686/libpthread.so.0(+0x6a37)[0xb4d77a37]
/lib/i686/libc.so.6(clone+0x5e)[0xb4a1d98e]

Exiv2 from video support branch rev. 2791
digiKam 3.0.0 from git.
Comment 30 caulier.gilles 2012-08-02 11:52:00 UTC
Another one :

digikam(8427)/digikam (core) Digikam::ImageScanner::addImage: Adding new item "/mnt/data/photos.test/Videos/2012-07-07_17-49-07_398.3gp"

(       32): ftyp      :
(  1214229): mdat      :Unprocessed
(    12880): moov      :(      108): mvhd      :
(    12154): trak      :
(       92): tkhd      :    Stream  |0|  
(    12054): mdia      :(       32): mdhd      :
(       37): hdlr      :
(    11977): minf      :(       20): vmhd      :
(       36): dinf      :(       28): dref      :(       12): url       :
(    11913): stbl      :(      117): stsd      :
(     7232): stts      :: 902
(      316): stsc      :Unprocessed
(     4016): stsz      :Unprocessed
(      204): stco      :Unprocessed
(       20): stss      :Unprocessed
(      610): trak      :
(       92): tkhd      :    Stream  |1|  
(      510): mdia      :(       32): mdhd      :
(       37): hdlr      :*** glibc detected *** /usr/bin/digikam: double free or corruption (!prev): 0xad352988 ***
======= Backtrace: =========
/lib/i686/libc.so.6(+0x6cbe2)[0xb49b5be2]
/usr/lib/libstdc++.so.6(_ZdlPv+0x1f)[0xb4bb9c7f]
/usr/lib/libstdc++.so.6(_ZdaPv+0x1b)[0xb4bb9cdb]
/usr/lib/libexiv2.so.12(_ZN5Exiv27DataBufD2Ev+0x28)[0xb381c64e]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo14handlerDecoderEm+0x686)[0xb38b85d0]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEm+0x254)[0xb38b57d8]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo11decodeBlockEv+0x177)[0xb38b555b]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo12readMetadataEv+0x3bd)[0xb38b52cd]
/usr/lib/libkexiv2.so.11(_ZNK11KExiv2Iface6KExiv24loadERK7QString+0x11c)[0xb7378c32]
/usr/lib/libdigikamcore.so.3(_ZNK7Digikam9DMetadata4loadERK7QString+0x37)[0xb6f11555]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam12ImageScanner12loadFromDiskEv+0x64)[0xb6afacec]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner11scanNewFileERK9QFileInfoi+0x86)[0xb6aa6008]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner9scanAlbumERKNS_18CollectionLocationERK7QString+0x610)[0xb6aa5516]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner9scanAlbumERKNS_18CollectionLocationERK7QString+0x7e4)[0xb6aa56ea]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner13scanAlbumRootERKNS_18CollectionLocationE+0x81)[0xb6aa4167]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner12completeScanEv+0x278)[0xb6aa2b56]
/usr/bin/digikam[0x81f7c6c]
/usr/lib/libQtCore.so.4(+0x67bf0)[0xb4df2bf0]
/lib/i686/libpthread.so.0(+0x6a37)[0xb4d77a37]
/lib/i686/libc.so.6(clone+0x5e)[0xb4a1d98e]

Gilles Caulier
Comment 31 caulier.gilles 2012-08-02 11:53:33 UTC
again :


digikam(8497)/digikam (core) Digikam::ImageScanner::addImage: Adding new item "/mnt/data/photos.test/Videos/05112011034.mp4"

(       32): ftyp      :
(  1214229): mdat      :Unprocessed
(    12880): moov      :(      108): mvhd      :
(    12154): trak      :
(       92): tkhd      :    Stream  |0|  
(    12054): mdia      :(       32): mdhd      :
(       37): hdlr      :
(    11977): minf      :(       20): vmhd      :
(       36): dinf      :(       28): dref      :(       12): url       :
(    11913): stbl      :(      117): stsd      :
(     7232): stts      :: 902
(      316): stsc      :Unprocessed
(     4016): stsz      :Unprocessed
(      204): stco      :Unprocessed
(       20): stss      :Unprocessed
(      610): trak      :
(       92): tkhd      :    Stream  |1|  
(      510): mdia      :(       32): mdhd      :
(       37): hdlr      :*** glibc detected *** /usr/bin/digikam: double free or corruption (!prev): 0xad30a7d8 ***
======= Backtrace: =========
/lib/i686/libc.so.6(+0x6cbe2)[0xb49b5be2]
/usr/lib/libstdc++.so.6(_ZdlPv+0x1f)[0xb4bb9c7f]
/usr/lib/libstdc++.so.6(_ZdaPv+0x1b)[0xb4bb9cdb]
/usr/lib/libexiv2.so.12(_ZN5Exiv27DataBufD2Ev+0x28)[0xb381c64e]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo14handlerDecoderEm+0x686)[0xb38b85d0]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo10tagDecoderERNS_7DataBufEm+0x254)[0xb38b57d8]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo11decodeBlockEv+0x177)[0xb38b555b]
/usr/lib/libexiv2.so.12(_ZN5Exiv214QuickTimeVideo12readMetadataEv+0x3bd)[0xb38b52cd]
/usr/lib/libkexiv2.so.11(_ZNK11KExiv2Iface6KExiv24loadERK7QString+0x11c)[0xb7378c32]
/usr/lib/libdigikamcore.so.3(_ZNK7Digikam9DMetadata4loadERK7QString+0x37)[0xb6f11555]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam12ImageScanner12loadFromDiskEv+0x64)[0xb6afacec]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner11scanNewFileERK9QFileInfoi+0x86)[0xb6aa6008]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner9scanAlbumERKNS_18CollectionLocationERK7QString+0x610)[0xb6aa5516]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner9scanAlbumERKNS_18CollectionLocationERK7QString+0x7e4)[0xb6aa56ea]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner13scanAlbumRootERKNS_18CollectionLocationE+0x81)[0xb6aa4167]
/usr/lib/libdigikamdatabase.so.3(_ZN7Digikam17CollectionScanner12completeScanEv+0x278)[0xb6aa2b56]
/usr/bin/digikam[0x81f7c6c]
/usr/lib/libQtCore.so.4(+0x67bf0)[0xb4df2bf0]
/lib/i686/libpthread.so.0(+0x6a37)[0xb4d77a37]
/lib/i686/libc.so.6(clone+0x5e)[0xb4a1d98e]

Gilles Caulier
Comment 32 caulier.gilles 2012-08-02 11:58:36 UTC
Same backtrace when i try to scan some video files collected through Exiv2 wiki. With this one especially 04072012033.mp4, i can see this bt from Exiv2 :

(gdb) bt
#0  0xb49b62fd in _int_free () from /lib/i686/libc.so.6
#1  0xb4bb9c7f in operator delete(void*) () from /usr/lib/libstdc++.so.6
#2  0xb4bb9cdb in operator delete[](void*) () from /usr/lib/libstdc++.so.6
#3  0xb381c64e in Exiv2::DataBuf::~DataBuf() () from /usr/lib/libexiv2.so.12
#4  0xb38b85d0 in Exiv2::QuickTimeVideo::handlerDecoder(unsigned long) () from /usr/lib/libexiv2.so.12
#5  0xb38b57d8 in Exiv2::QuickTimeVideo::tagDecoder(Exiv2::DataBuf&, unsigned long) () from /usr/lib/libexiv2.so.12
#6  0xb38b555b in Exiv2::QuickTimeVideo::decodeBlock() () from /usr/lib/libexiv2.so.12
#7  0xb38b52cd in Exiv2::QuickTimeVideo::readMetadata() () from /usr/lib/libexiv2.so.12
#8  0xb7378c32 in KExiv2Iface::KExiv2::load (this=0xadc19dc8, filePath=...)
    at /mnt/data/Devel/GIT/3.x/extra/libkexiv2/libkexiv2/kexiv2.cpp:300
#9  0xb6f11555 in Digikam::DMetadata::load (this=0xadc19dc8, filePath=...) at /mnt/data/Devel/GIT/3.x/core/libs/dmetadata/dmetadata.cpp:109
#10 0xb6afacec in Digikam::ImageScanner::loadFromDisk (this=0xadc19dc0) at /mnt/data/Devel/GIT/3.x/core/libs/database/imagescanner.cpp:1250
#11 0xb6aa6008 in Digikam::CollectionScanner::scanNewFile (this=0xadc1a1a4, info=..., albumId=300)
    at /mnt/data/Devel/GIT/3.x/core/libs/database/collectionscanner.cpp:1026
#12 0xb6aa5516 in Digikam::CollectionScanner::scanAlbum (this=0xadc1a1a4, location=..., album=...)
    at /mnt/data/Devel/GIT/3.x/core/libs/database/collectionscanner.cpp:903
#13 0xb6aa56ea in Digikam::CollectionScanner::scanAlbum (this=0xadc1a1a4, location=..., album=...)
    at /mnt/data/Devel/GIT/3.x/core/libs/database/collectionscanner.cpp:926
#14 0xb6aa4167 in Digikam::CollectionScanner::scanAlbumRoot (this=0xadc1a1a4, location=...)
    at /mnt/data/Devel/GIT/3.x/core/libs/database/collectionscanner.cpp:658
#15 0xb6aa2b56 in Digikam::CollectionScanner::completeScan (this=0xadc1a1a4)
    at /mnt/data/Devel/GIT/3.x/core/libs/database/collectionscanner.cpp:332
#16 0x081f7c6c in Digikam::ScanController::run (this=0x86c6b10) at /mnt/data/Devel/GIT/3.x/core/digikam/database/scancontroller.cpp:732
#17 0xb4df2bf0 in ?? () from /usr/lib/libQtCore.so.4
#18 0xb4d77a37 in start_thread () from /lib/i686/libpthread.so.0
#19 0xb4a1d98e in clone () from /lib/i686/libc.so.6
Backtrace stopped: Not enough registers or memory available to unwind further
(gdb) 

Gilles Caulier
Comment 33 caulier.gilles 2012-08-02 12:23:20 UTC
My Advanced Video Search mockup based on registered video properties from DB (which are currently show on Properties tab and tooltip :

http://www.flickr.com/photos/digikam/7697497988/sizes/o/in/photostream/

Gilles Caulier
Comment 34 caulier.gilles 2012-08-02 12:27:21 UTC
Created attachment 72896 [details]
Video Search mockup patch

This is the patch to introduce video search properties in Advanced Search tool... It's only GUI stuff, nothing is done in background on DB to perform search. This must be implemented.

Also review values that i assigned to video search field. Some need to be adapted and fixed... Look TODO also.

This is the good start to implement video search feature.

Gilles Caulier
Comment 35 caulier.gilles 2012-08-02 14:33:55 UTC
Abhinav,

Adavanced Search tool GUI is located here in reprository :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/show/utilities/searchwindow?rev=development%2F3.0.0

With my previous patch introducing video search fields, i patched :

- SearchGroup::setup() where i add Video Properties section with fields relevant. Each fields are identified by a string name, as "format" from "Picture Properties" for exemple. The declaration of fields is simple in SearchGroup class but require to change another class to have effect on GUI.
- SearchField::createField() implement how a GUI will manage a field for end user. If you look at "format" properties, it will provide a clickable link to pop-up a list of possible values to use. Values are passed to a QStringList. For each value, you set a pair of strings. The first is to query in DB, and second to display in GUI. There are some other GUI possibility, for ex. to set a range of values. Look my patch for details.

When GUI is patch you need to implement the way to use this fields in way to query DB. The Adv Search tool use an XML string to query the DB, through a dedicated interface located here :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/changes/libs/database/searchxml.h?rev=development%2F3.0.0

SearchXML can encode a query from Adv. Search tool GUI to an XML string, including section, fields, values,  groups, sub-groups, operators, etc... This XML is string is passed to DB to query really data through SQL. With XML you can create complex queries, human readable to hack, intead to play with SQL directly.

Advanced Search tool call SearchXML interface by :

==> 
https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/utilities/searchwindow/searchwindow.cpp?rev=development%2F3.0.0#L130

... When press Ok button from dialog.

==> Which emit searchEdited() with current XML string generated by view this method :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/utilities/searchwindow/searchview.cpp?rev=development%2F3.0.0#L293

... where SearchXmlWriter is used.

==> signal emitted arrive to this slot :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/utilities/searchwindow/searchtabheader.cpp?rev=development%2F3.0.0#L566

... where xml string is passed to create or update AlbumManager content with the query to use. Note that XML string is directly stored in DB for future use, in case of you save search album.

==> AlbumManager pass XML query here :

https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/digikam/album/albummanager.cpp?rev=development%2F3.0.0#L2691

... to the AlbumDB class to query the database of course, through addSearch() method. This one re-route the query to DatabaseCoreBackend class...

==> The most important part to patch to implement Video Search query, is ImageQueryBuilder, with is the XML query to SQL translator, especially in ImageQueryBuilder::buildField() method, where each search fields are implemented as SQL query. You will find the inverse wrap using same field names than  SearchField class use...

https://projects.kde.org/projects/extragear/graphics/digikam/repository/entry/libs/database/imagequerybuilder.cpp?rev=development%2F3.0.0#L779

Gilles Caulier
Comment 36 caulier.gilles 2012-08-02 14:35:14 UTC
Marcel, if i forget something or i'm wrong somewhere in my comment #35, please fix me (:=)))...

Gilles Caulier
Comment 37 Abhinav Badola 2012-08-02 16:28:55 UTC
Hi Gilles,

Quicktime video backend is not properly complete, so I assume that there may be some bugs that may occur. I will look into the matter soon and fix the bug.

For now, Matroska video format is complete(I hope it will produce no bugs. I tested MKV and WEBM formats, and they performed perfectly). I have left the aspect ratio for now, since that would be common to all, I plan to put it in a separate file. It can be completed any time.

Apart from that, right now, I am making some changes and completing the missing decoding requiered in Riff format after that. It will take about one-two more days. After that I will patch quicktime, and will start with ASF format soon.

I plan to get back to digiKam Advanced Search GUI after that. Once the read metadata backend is complete.
Comment 38 caulier.gilles 2012-08-02 17:41:07 UTC
Abhinav,

Plan sound fine for me...

What' s about WebP support ? 

http://en.wikipedia.org/wiki/WebP

It's based on Riff format, as AVI video format. It can be supported as well without any specific patch ?

If yes, i can plan to add Webp google image support in digiKam core...

Gilles
Comment 39 Abhinav Badola 2012-08-02 18:36:19 UTC
Hi Gilles,

Adding WebP doesn't seem that much of a problem to me. Sure we can add it. It would be nice if we add support for WebP simultaneously with AVI.

I was testing some example of WebP. They are based on RIFF container but they didn't seem to contain any additional metadata information (I tested the example image provided with https://code.google.com/p/webp/downloads/detail?name=libwebp-0.1.99.tar.gz ).

Can you please give me some links to WebP examples, so that I can test them as well..?

Currently I am enhancing RIFF format only, so I can use them as test cases as well, and report back if I find any problem with the implementation.
Comment 40 caulier.gilles 2012-08-02 20:09:33 UTC
Do you tried with these files :

https://developers.google.com/speed/webp/gallery1
Comment 41 Abhinav Badola 2012-08-02 20:19:57 UTC
Yes, I tried the above link as well. They don't have any additional metadata information in them. I checked using exiftool as well, but it didn't show any addtional metadata other than-

ExifTool Version Number         : 8.40
File Name                              : 5.webp
Directory                                : /home/badola/Downloads
File Size                                : 81 kB
File Modification Date/Time     : 2012:08:03 00:30:58+05:30
File Permissions                    : rw-r--r--
File Type                               : WEBP
MIME Type                            : image/webp

That is all that I found in these images.

Other than that I checked this link- http://webp.googlecode.com/files/webp-samples.zip
And it only has PNG files which are encoded using WebP codec, I guess. Exiv2 was not able to decode them so I used exiftool. It showed that the images are of PNG type and not WebP -

badola@XPS:~> exiftool ~/Downloads/webp-samples/4_webp.png 
ExifTool Version Number         : 8.40
File Name                              : 4_webp.png
Directory                                : /home/badola/Downloads/webp-samples
File Size                                : 2.6 MB
File Modification Date/Time     : 2010:09:30 20:51:32+05:30
File Permissions                    : r-xr-x---
File Type                               : PNG
MIME Type                            : image/png
Image Width                          : 2048
Image Height                         : 1536
Bit Depth                              : 8
Color Type                            : RGB
Compression                        : Deflate/Inflate
Filter                                    : Adaptive
Interlace                               : Noninterlaced
Pixels Per Unit X                   : 72
Pixels Per Unit Y                  : 72
Pixel Units                           : Unknown
Virtual Image Width              : 2048
Virtual Image Height             : 1536
Virtual Page Units                : 0
Image Size                          : 2048x1536



badola@XPS:~> exiv2 ~/Downloads/webp-samples/4_webp.png 
File name       : /home/badola/Downloads/webp-samples/4_webp.png
File size         : 2707632 Bytes
MIME type       : image/png
Image size      : 2048 x 1536
/home/badola/Downloads/webp-samples/4_webp.png: No Exif data found in the file


So I am still falling short of test samples.
Comment 42 Abhinav Badola 2012-08-18 23:01:45 UTC
Git commit 91f5de3e438ee810c740bd1e0d3f2b245b5924c4 by Abhinav Badola.
Committed on 19/08/2012 at 01:01.
Pushed by badola into branch 'development/3.0.0'.

Updated dmetadata.cpp, changed the way XMP data is fetched from containers.

M  +17   -17   libs/dmetadata/dmetadata.cpp

http://commits.kde.org/digikam/91f5de3e438ee810c740bd1e0d3f2b245b5924c4
Comment 43 Yiou Wang 2013-05-03 02:45:31 UTC
Created attachment 79649 [details]
Implement Video Advanced Search feature

I made a patch which implements video advance search feature.
Comparing to Gilles's GUI mockup patch, I changed several fields from SearchFieldChoice to SearchFieldRangeInt because some fields are not standard, so it will be difficult if only given several choices.
Comment 44 Yiou Wang 2013-05-07 12:23:56 UTC
Hello everyone,

I'd like to know if there's any news on this bug? Does this patch work fine?

Thanks :)
Comment 45 caulier.gilles 2013-05-07 13:54:50 UTC
Yiou,

Just tested. Patch work as expected. Congratulations...

Gilles Caulier
Comment 46 Yiou Wang 2013-05-07 13:55:34 UTC
(In reply to comment #45)
> Yiou,
> 
> Just tested. Patch work as expected. Congratulations...
> 
> Gilles Caulier
Thank you very much Gilles :)
Comment 47 caulier.gilles 2013-05-07 13:57:52 UTC
Git commit 2434a79b8c16edac245e2a64d982bacf1d94fc64 by Gilles Caulier.
Committed on 07/05/2013 at 15:56.
Pushed by cgilles into branch 'master'.

apply patch #79649 from Yiou Wang to support Video properties search in Advanced Search tool.
CCMAIL: geow812@gmail.com
FIXED-IN: 3.2.0

M  +177  -13   libs/database/imagequerybuilder.cpp
M  +114  -0    utilities/searchwindow/searchfields.cpp
M  +20   -0    utilities/searchwindow/searchgroup.cpp
M  +1    -0    utilities/searchwindow/searchview.cpp

http://commits.kde.org/digikam/2434a79b8c16edac245e2a64d982bacf1d94fc64