gstreamer/ext/metadata
Stefan Kost f096d6406e metadata: fix conversion of geo coordinates
Coordinate conversion has been verified with exiv2 and some webpages.
Minutes wher totally off and seconds were not used at all.
2009-06-22 13:33:32 +03:00
..
.gitignore Changed kclass to "Parser/Extracter/Metadata", changed caps to "image/jpeg, tags-extract=true/false" and changed prio... 2007-10-30 18:21:22 +00:00
gstbasemetadata.c metadata: also post error message when returning error 2009-02-12 10:51:20 +01:00
gstbasemetadata.h Fix gtk-doc warnings. Also don't misuse api-doc comments for normal comments. 2008-06-18 06:31:13 +00:00
gstmetadata.c Added new module for common functions. Using GST_TYPE_FRACTION for Exif (S)Rational types. 2007-12-14 18:18:37 +00:00
gstmetadatademux.c Do not use short_description in section docs for elements. We extract them from element details and there will be war... 2008-06-12 14:49:18 +00:00
gstmetadatademux.h Add some documentation. 2008-01-23 16:35:34 +00:00
gstmetadatamux.c Configure byte order for EXIF. Fixes #568704 2009-01-23 15:14:24 +02:00
gstmetadatamux.h Configure byte order for EXIF. Fixes #568704 2009-01-23 15:14:24 +02:00
Makefile.am Don't install static libs for plugins. Fixes #550851 for -bad. 2008-11-04 12:42:30 +00:00
metadata.c metadata: rework doc comment 2009-03-22 21:02:45 +02:00
metadata.h Add lot of documentation. 2008-01-25 17:45:28 +00:00
metadata_mapping.htm ext/metadata/: Add mapping of format and mime type to xmp. 2008-10-03 05:57:58 +00:00
metadataexif.c metadata: fix conversion of geo coordinates 2009-06-22 13:33:32 +03:00
metadataexif.h metdata: more logging and code cleanups 2009-03-22 21:02:45 +02:00
metadataiptc.c Add documentation. 2008-01-31 21:55:44 +00:00
metadataiptc.h metdata: more logging and code cleanups 2009-03-22 21:02:45 +02:00
metadatamuxjpeg.c metdata: more logging and code cleanups 2009-03-22 21:02:45 +02:00
metadatamuxjpeg.h Add documentation. Fix test app compilation. Fix pull mode. 2008-01-30 12:56:51 +00:00
metadatamuxpng.c metdata: more logging and code cleanups 2009-03-22 21:02:45 +02:00
metadatamuxpng.h Add documentation. Fix test app compilation. Fix pull mode. 2008-01-30 12:56:51 +00:00
metadataparsejpeg.c metdata: more logging and code cleanups 2009-03-22 21:02:45 +02:00
metadataparsejpeg.h Add lot of documentation. 2008-01-25 17:45:28 +00:00
metadataparsepng.c metdata: more logging and code cleanups 2009-03-22 21:02:45 +02:00
metadataparsepng.h Add lot of documentation. 2008-01-25 17:45:28 +00:00
metadataparseutil.c Add lot of documentation. 2008-01-25 17:45:28 +00:00
metadataparseutil.h ext/metadata/Makefile.am: Add some relevant variables to CFLAGS and LIBADD, for example our compiler warnings paramters. 2008-01-31 10:16:46 +00:00
metadatatags.c configure.ac 2008-10-06 16:01:49 +00:00
metadatatags.h configure.ac 2008-10-06 16:01:49 +00:00
metadatatypes.c Add documentation. Speed up a bit png muxer. Fix xmp muxer. 2008-01-30 16:05:24 +00:00
metadatatypes.h Add documentation. Speed up a bit png muxer. Fix xmp muxer. 2008-01-30 16:05:24 +00:00
metadataxmp.c ext/metadata/: Add mapping of format and mime type to xmp. 2008-10-03 05:57:58 +00:00
metadataxmp.h metdata: more logging and code cleanups 2009-03-22 21:02:45 +02:00
README configure.ac 2008-10-06 16:01:49 +00:00
TODO Map Date-Time and GPS tags and Convert from EXIF to XMP Datatime as local time (those changes has been done in previo... 2008-02-28 10:41:56 +00:00

### design proposal for metadata mux and parser ###

## use cases ##

1- Create metadata

[ App send tag events to the pipeline ]
  ||               /\
  ||               ||
  ||          jpegenc send tag messages like (width, height and compression info)
  ||               ||
  \/               ||
+---------+    +---------+    +-------------+    +----------+
| v4l2src | -> | jpegenc | -> | metadatamux | -> | filesink |
+---------+    +---------+    +-------------+    +----------+

* elements like videoscale should also send (width and height tags)
* should metadatamux get info from caps (width and height) and use if not receive a event with such tags?


2- View metadata

+---------+    +---------------+    +---------+    +-------------+
| filesrc | -> | metadataparse | -> | jpegdec | -> | xvimagesink |
+---------+    +---------------+    +---------+    +-------------+

or

                    +--> whole chunk send as event to next element
                    |
+---------+    +---------------+    +----------+
| filesrc | -> | metadataparse | -> | fakesink |
+---------+    +---------------+    +----------+
                    ||
                    \/
               1- individual tags send as messages (what about not mapped tags??)
               2- whole chunk send as message (probably the application will ignore this)

* in any case metadataparse strips out metadata chunks (different from current implementation)


3- Modify (add, change, delete tags)

                    +--> whole chunk send as event to next element -- ... --+
                    |                                                       |
                    |                                                       V
+---------+    +---------------+                                     +-------------+    +----------+
| filesrc | -> | metadataparse | --------------- ... --------------> | metadatamux | -> | filesink |
+---------+    +---------------+                                     +-------------+    +----------+
  /\                ||
  ||                \/
  ||           1- individual tags send as messages (what about not mapped tags??) ==============\\
  ||           2- whole chunk send as message (probably the application will ignore this)       ||
  ||                                                                                            ||
[ App send tag events to the pipeline ] <=======================================================//

* metadataparse strips out metadata chunks (different from current implementation)
* application receives individual tag messages (what about not mapped ones?)
  * the application only send events back to the pipeline for the tags the application wants to modify or keep.
    The tags not sent will not be included in metadata chunks
* the metadatamux modify the whole chunk event received before to just keep the individual tags sent by application
* the metadatamux could have a property to say if it should remove or keep tags not sent by application. 

Obs: By looking at the proposed design (1- view and 2- modify) seems that the metadataparse and metadatamux should not know about mapped tags.
     Only the application map the tags to/from metadata specific format. This is because, if you notice, only tags sent by application will be keep
     on new file.


4- Convert (for example from jpeg to png)

                      +--> whole chunk send as event to next element -- ... --+
                      |                                                       |
                      |                                                       V
+---------+    +---------------+                                        +-------------+    +----------+
| filesrc | -> | metadataparse | -> | jpegdec | -> ... -> | pngenc | -> | metadatamux | -> | filesink |
+---------+    +---------------+                                        +-------------+    +----------+
  /\                ||
  ||                \/
  ||           1- individual tags send as messages (what about not mapped tags??) ==============\\
  ||           2- whole chunk send as message (probably the application will ignore this)       ||
  ||                                                                                            ||
[ App send tag events to the pipeline ] <=======================================================//

* in this case the application set the metadatamux property to always keep the tags by default (application don't not need to send tag events)
* metadatamux needs additional smartness to check what tags still does make sense (some from original jpeg may not make sense anymore)
* if the image is resized, the videoscale should send messages to the application with new width (in the same way pngenc should also) and the
  application could send width and height tag events to the pipeline
* should metadatamux get info from caps (width and height) and use if not receive a event with such tags?


Testing
GST_DEBUG="*:2,metadata*:4" 
gst-launch videotestsrc num-buffers=1 ! jpegenc ! taginject  tags="geo-location-latitude=66.1,geo-location-longitude=22.5,geo-location-elevation=10.3" ! metadatamux ! filesink location="meta_test_ppp.jpeg"
gst-launch videotestsrc num-buffers=1 ! jpegenc ! taginject  tags="geo-location-latitude=66.1,geo-location-longitude=22.5,geo-location-elevation=-10.3" ! metadatamux ! filesink location="meta_test_ppn.jpeg"
gst-launch videotestsrc num-buffers=1 ! jpegenc ! taginject  tags="geo-location-latitude=66.1,geo-location-longitude=-22.5,geo-location-elevation=10.3" ! metadatamux ! filesink location="meta_test_pnp.jpeg"
gst-launch videotestsrc num-buffers=1 ! jpegenc ! taginject  tags="geo-location-latitude=66.1,geo-location-longitude=-22.5,geo-location-elevation=-10.3" ! metadatamux ! filesink location="meta_test_pnn.jpeg"
gst-launch videotestsrc num-buffers=1 ! jpegenc ! taginject  tags="geo-location-latitude=-66.1,geo-location-longitude=22.5,geo-location-elevation=10.3" ! metadatamux ! filesink location="meta_test_npp.jpeg"
gst-launch videotestsrc num-buffers=1 ! jpegenc ! taginject  tags="geo-location-latitude=-66.1,geo-location-longitude=22.5,geo-location-elevation=-10.3" ! metadatamux ! filesink location="meta_test_npn.jpeg"
gst-launch videotestsrc num-buffers=1 ! jpegenc ! taginject  tags="geo-location-latitude=-66.1,geo-location-longitude=-22.5,geo-location-elevation=10.3" ! metadatamux ! filesink location="meta_test_nnp.jpeg"
gst-launch videotestsrc num-buffers=1 ! jpegenc ! taginject  tags="geo-location-latitude=-66.1,geo-location-longitude=-22.5,geo-location-elevation=-10.3" ! metadatamux ! filesink location="meta_test_nnn.jpeg"

exiv2 -pt pr meta_test_ppp.jpeg | grep "Exif.GPSInfo"
exif meta_test_ppp.jpeg

gst-launch -t filesrc location="meta_test_ppp.jpeg" ! metadatademux ! fakesink