[ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

David Greenwood
hi everyone!

i have a 360 video (.mp4) shot using a GoPro Fusion with embedded gps (gpmd
track).

i am trying to break the video into frames (1 per second), either png or
jpg, whilst preserving certain global metadata, like camera make, but most
importantly timestamps.

my idea was to first extract the metadata using exiftool, break the video
down into frames using ffmpeg, and then geocode the frames based on times
using exiftool.

the issue, i have not been able to figure out how to properly preserve
metadata during conversion in ffmpeg from mp4 to jpg/png. importantly, this
means the images do not have a capture time.

now i'm starting to consider using a custom script to offset based on frame
rate (e.g. start at 12:00 (start time of vid) and add +1 sec to each frame
timestamp) using a custom script.

before i jump into this, i was wondering if ffmpeg could handle this
natively in the conversion?

based on web searches i've tried a lot of flag combinations, alas, no
success, e.g.

ffmpeg -i VIDEO_7152.mp4 -r 1 -map_metadata 0:g FRAMES/img%04d.png

ffmpeg -i VIDEO_7152.mp4 -r 1 -movflags use_metadata_tag FRAMES/img%04d.png

if anyone could validate/invalidate whether this is even possible in ffmpeg
that would be useful in helping me figure out what to do next.

here is the video file:
https://drive.google.com/file/d/1XspMMI4Vd4eX4yLJ-FAwKOadhYzmjxH1/view?usp=sharing

thank you!

-dave

--
*David Greenwood*
Chief Explorer

https://www.trekview.org
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Carl Eugen Hoyos-2
Am Do., 21. Mai 2020 um 16:21 Uhr schrieb David Greenwood
<[hidden email]>:

> the issue, i have not been able to figure out how to properly preserve
> metadata during conversion in ffmpeg from mp4 to jpg/png. importantly,
> this means the images do not have a capture time.

Do you have a jpg/png that contains timestamps?

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

David Greenwood
Nope.

The original video .mp4 has a start time and duration in the metadata.

When converting to image files, the only timestamps they hold are for
creation date (system time on script run).


On Thu, 21 May 2020 at 15:28, Carl Eugen Hoyos <[hidden email]> wrote:

> Am Do., 21. Mai 2020 um 16:21 Uhr schrieb David Greenwood
> <[hidden email]>:
>
> > the issue, i have not been able to figure out how to properly preserve
> > metadata during conversion in ffmpeg from mp4 to jpg/png. importantly,
> > this means the images do not have a capture time.
>
> Do you have a jpg/png that contains timestamps?
>
> Carl Eugen
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".



--
*David Greenwood*
Chief Explorer

https://www.trekview.org
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Carl Eugen Hoyos-2
Am Do., 21. Mai 2020 um 16:46 Uhr schrieb David Greenwood
<[hidden email]>:
>
> Nope.

If such files do not exist, it seems unlikely that ffmpeg
can produce them.

Please find out what top-posting means and avoid
it here.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Michael Koch
Am 21.05.2020 um 17:07 schrieb Carl Eugen Hoyos:
> Am Do., 21. Mai 2020 um 16:46 Uhr schrieb David Greenwood
> <[hidden email]>:
>> Nope.
> If such files do not exist, it seems unlikely that ffmpeg
> can produce them.

I have a JPG image for which exiftool reports six times:
-- File Modification Date/Time
-- File Access Date/Time
-- File Creation Date/Time
-- Modify Date
-- Date/Time Original
-- Create Date

Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Kieran O Leary
On Thu, May 21, 2020 at 6:05 PM Michael Koch <[hidden email]>
wrote:

> Am 21.05.2020 um 17:07 schrieb Carl Eugen Hoyos:
> > Am Do., 21. Mai 2020 um 16:46 Uhr schrieb David Greenwood
> > <[hidden email]>:
> >> Nope.
> > If such files do not exist, it seems unlikely that ffmpeg
> > can produce them.
>
> I have a JPG image for which exiftool reports six times:
> -- File Modification Date/Time
> -- File Access Date/Time
> -- File Creation Date/Time
> -- Modify Date
> -- Date/Time Original
> -- Create Date
>

Aren't some of those just file system metadata, not in the actual JPG
itself?

-K
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Michael Koch
Am 21.05.2020 um 21:05 schrieb Kieran O Leary:

> On Thu, May 21, 2020 at 6:05 PM Michael Koch <[hidden email]>
> wrote:
>
>> Am 21.05.2020 um 17:07 schrieb Carl Eugen Hoyos:
>>> Am Do., 21. Mai 2020 um 16:46 Uhr schrieb David Greenwood
>>> <[hidden email]>:
>>>> Nope.
>>> If such files do not exist, it seems unlikely that ffmpeg
>>> can produce them.
>> I have a JPG image for which exiftool reports six times:
>> -- File Modification Date/Time
>> -- File Access Date/Time
>> -- File Creation Date/Time
>> -- Modify Date
>> -- Date/Time Original
>> -- Create Date
>>
> Aren't some of those just file system metadata, not in the actual JPG
> itself?

I don't know. Exiftool reports these 6 dates / times. For some other
JPG's it reports only 3.

Michael

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Moritz Barsnick
In reply to this post by Kieran O Leary
On Thu, May 21, 2020 at 20:05:10 +0100, Kieran O Leary wrote:

> On Thu, May 21, 2020 at 6:05 PM Michael Koch <[hidden email]>
> > I have a JPG image for which exiftool reports six times:
> > -- File Modification Date/Time
> > -- File Access Date/Time
> > -- File Creation Date/Time
> > -- Modify Date
> > -- Date/Time Original
> > -- Create Date
> Aren't some of those just file system metadata, not in the actual JPG
> itself?

I was wondering the same thing, but my (perhaps newer) exiftool only
reports the first three on a "bare" JPG file.

OTOH, I believe ffmpeg is not capable of writing any metadata for JPG,
not even non-EXIF.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Nicolas George
In reply to this post by Kieran O Leary
Kieran O Leary (12020-05-21):
> > I have a JPG image for which exiftool reports six times:
> > -- File Modification Date/Time
> > -- File Access Date/Time
> > -- File Creation Date/Time
> > -- Modify Date
> > -- Date/Time Original
> > -- Create Date

> Aren't some of those just file system metadata, not in the actual JPG
> itself?

The "File" fields, obviously. But I very much doubt that a file system
would store both a "File Modification Date/Time" and a "Modify Date",
don't you?

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Kieran O Leary
On Thu, May 21, 2020 at 9:31 PM Nicolas George <[hidden email]> wrote:

> Kieran O Leary (12020-05-21):
> > > I have a JPG image for which exiftool reports six times:
> > > -- File Modification Date/Time
> > > -- File Access Date/Time
> > > -- File Creation Date/Time
> > > -- Modify Date
> > > -- Date/Time Original
> > > -- Create Date
>
> > Aren't some of those just file system metadata, not in the actual JPG
> > itself?
>
> The "File" fields, obviously. But I very much doubt that a file system
> would store both a "File Modification Date/Time" and a "Modify Date",
> don't you?
>

I agree with you.

K
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Michael Koch
In reply to this post by Nicolas George
Am 21.05.2020 um 22:31 schrieb Nicolas George:

> Kieran O Leary (12020-05-21):
>>> I have a JPG image for which exiftool reports six times:
>>> -- File Modification Date/Time
>>> -- File Access Date/Time
>>> -- File Creation Date/Time
>>> -- Modify Date
>>> -- Date/Time Original
>>> -- Create Date
>> Aren't some of those just file system metadata, not in the actual JPG
>> itself?
> The "File" fields, obviously. But I very much doubt that a file system
> would store both a "File Modification Date/Time" and a "Modify Date",
> don't you?

here is an example of a JPG for which exiftool (version 11.26) reports 6
dates/times:
http://www.astro-electronic.de/IMG_1343.jpg

Michael
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Nicolas George
Michael Koch (12020-05-22):
> here is an example of a JPG for which exiftool (version 11.26) reports 6
> dates/times:
> http://www.astro-electronic.de/IMG_1343.jpg

File Modification Date/Time     : 2020:05:22 07:46:54+02:00
File Access Date/Time           : 2020:05:22 11:51:04+02:00
File Inode Change Date/Time     : 2020:05:22 11:51:00+02:00

Spot the difference with your version?

Regards,

--
  Nicolas George

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Michael Koch
Am 22.05.2020 um 11:52 schrieb Nicolas George:
> Michael Koch (12020-05-22):
>> here is an example of a JPG for which exiftool (version 11.26) reports 6
>> dates/times:
>> http://www.astro-electronic.de/IMG_1343.jpg
> File Modification Date/Time     : 2020:05:22 07:46:54+02:00
> File Access Date/Time           : 2020:05:22 11:51:04+02:00
> File Inode Change Date/Time     : 2020:05:22 11:51:00+02:00
>
> Spot the difference with your version?

This is what my version of exiftool reports:

C:\Users\mKoch\Desktop>c:\ffmpeg\exiftool
C:\Users\mKoch\Desktop\IMG_1343.jpg -u

ExifTool Version Number         : 11.26
File Name                       : IMG_1343.jpg
Directory                       : C:/Users/mKoch/Desktop
File Size                       : 3.4 MB
File Modification Date/Time     : 2020:05:22 07:15:10+02:00<---
File Access Date/Time           : 2020:05:22 13:06:37+02:00    <---
File Creation Date/Time         : 2020:05:22 13:06:37+02:00    <---
File Permissions                : rw-rw-rw-
File Type                       : JPEG
File Type Extension             : jpg
MIME Type                       : image/jpeg
Exif Byte Order                 : Little-endian (Intel, II)
Image Description               :
Make                            : Canon
Camera Model Name               : Canon IXUS 107
Orientation                     : Horizontal (normal)
X Resolution                    : 180
Y Resolution                    : 180
Resolution Unit                 : inches
Modify Date                     : 2020:05:22 07:15:10<---
Y Cb Cr Positioning             : Co-sited
Exposure Time                   : 1/60
F Number                        : 2.8
ISO                             : 200
Exif Version                    : 0221
Date/Time Original              : 2020:05:22 07:15:10<---
Create Date                     : 2020:05:22 07:15:10          <---
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 3
Shutter Speed Value             : 1/60
Aperture Value                  : 2.8
Max Aperture Value              : 2.8
Flash                           : Auto, Did not fire
Focal Length                    : 5.0 mm
Macro Mode                      : Normal
Self Timer                      : Off
Quality                         : Fine
Canon Flash Mode                : Auto
Continuous Drive                : Single
Focus Mode                      : Single
Record Mode                     : JPEG
Canon Image Size                : Large
Easy Mode                       : Night Snapshot
Digital Zoom                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : 0
Camera ISO                      : Auto
Metering Mode                   : Evaluative
Focus Range                     : Auto
AF Point                        : Manual AF point selection
Canon Exposure Mode             : Easy
Lens Type                       : n/a
Max Focal Length                : 20 mm
Min Focal Length                : 5 mm
Focal Units                     : 1000/mm
Max Aperture                    : 2.8
Min Aperture                    : 8
Flash Bits                      : (none)
Focus Continuous                : Single
AE Setting                      : Normal AE
Image Stabilization             : Shoot Only
Zoom Source Width               : 4000
Zoom Target Width               : 4000
Spot Metering Mode              : Center
Manual Flash Output             : n/a
Focal Type                      : Zoom
Focal Plane X Size              : 6.30 mm
Focal Plane Y Size              : 4.72 mm
Canon Flash Info                : 0 0 0 0
Auto ISO                        : 192
Base ISO                        : 100
Measured EV                     : 8.81
Target Aperture                 : 2.8
Target Exposure Time            : 1/60
Exposure Compensation           : 0
White Balance                   : Auto
Slow Shutter                    : Off
Shot Number In Continuous Burst : 0
Optical Zoom Code               : 0
Flash Guide Number              : 0
Flash Exposure Compensation     : 0
Auto Exposure Bracketing        : Off
AEB Bracket Value               : 0
Control Mode                    : Camera Local Control
Focus Distance Upper            : 1.6 m
Focus Distance Lower            : 0 m
Bulb Duration                   : 0
Camera Type                     : Compact
Auto Rotate                     : None
ND Filter                       : Off
Self Timer 2                    : 0
Flash Output                    : 0
Canon Image Type                : IMG:IXUS 107 JPEG
Canon Firmware Version          : Firmware Version 1.00
File Number                     : 164-1343
Owner Name                      :
Rotation                        : 0
Camera Temperature              : 18 C
Canon Model ID                  : PowerShot SD1300 IS / IXUS 105 / IXY 200F
AF Info Size                    : 98
AF Area Mode                    : Single-point AF
Num AF Points                   : 9
Valid AF Points                 : 1
Canon Image Width               : 4000
Canon Image Height              : 3000
AF Image Width                  : 100
AF Image Height                 : 100
AF Area Widths                  : 18 0 0 0 0 0 0 0 0
AF Area Heights                 : 18 0 0 0 0 0 0 0 0
AF Area X Positions             : 0 0 0 0 0 0 0 0 0
AF Area Y Positions             : 0 0 0 0 0 0 0 0 0
AF Points In Focus              : 0
Canon AF Info 2 0x000d          : 0 0
Primary AF Point                : 0
Thumbnail Image Valid Area      : 0 0 0 0
Canon 0x0018                    : 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0
0 0 0 0 0[...]
Canon 0x0019                    : 1
Date Stamp Mode                 : Off
My Color Mode                   : Off
Firmware Revision               : 1.00 rev 2.00
Canon 0x001f                    : 138 1 0 4 8 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0
0 0 0 0 0[...]
Canon 0x0022                    : 416 0 0 16 8 1 1 640 480 0 0 0 0 0 8
384 0 0 0
  0 0 0 0 [...]
Categories                      : (none)
Intelligent Contrast            : Off
Image Unique ID                 : 70e32bb40af52a0f02fb8b957dba76aa
VRD Offset                      : 0
Canon 0x002d                    : 0
Canon 0x002e                    : 8 32767 32767 65535
Faces Detected                  : 65535
User Comment                    :
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 4000
Exif Image Height               : 3000
Interoperability Index          : R98 - DCF basic file (sRGB)
Interoperability Version        : 0100
Related Image Width             : 4000
Related Image Height            : 3000
Focal Plane X Resolution        : 16460.90535
Focal Plane Y Resolution        : 16483.51648
Focal Plane Resolution Unit     : inches
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Custom Rendered                 : Normal
Exposure Mode                   : Auto
Digital Zoom Ratio              : 1
Scene Capture Type              : Night
Compression                     : JPEG (old-style)
Thumbnail Offset                : 5120
Thumbnail Length                : 11264
Image Width                     : 4000
Image Height                    : 3000
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Aperture                        : 2.8
Drive Mode                      : Single-frame Shooting
Image Size                      : 4000x3000
Lens                            : 5.0 - 20.0 mm
Lens ID                         : Unknown 5-20mm
Megapixels                      : 12.0
Scale Factor To 35 mm Equivalent: 5.6
Shooting Mode                   : Night Snapshot
Shutter Speed                   : 1/60
Thumbnail Image                 : (Binary data 11264 bytes, use -b
option to ext
ract)
Circle Of Confusion             : 0.005 mm
Depth Of Field                  : 0.99 m (0.54 - 1.53 m)
Field Of View                   : 65.4 deg
Focal Length                    : 5.0 mm (35 mm equivalent: 28.1 mm)
Hyperfocal Distance             : 1.67 m
Lens                            : 5.0 - 20.0 mm (35 mm equivalent: 28.1
- 112.2
mm)
Light Value                     : 7.9


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: [ffmpeg] preserving metadata from .mp4 to .jpg/.png frames

Moritz Barsnick
In reply to this post by Michael Koch
On Fri, May 22, 2020 at 07:52:14 +0200, Michael Koch wrote:
> here is an example of a JPG for which exiftool (version 11.26) reports 6
> dates/times:
> http://www.astro-electronic.de/IMG_1343.jpg

Yes, that file contains actual EXIF metadata, including date tags.

That doesn't change the fact that ffmpeg currently isn't able to create
EXIF metadata, even if it is able to parse it from some formats.

Moritz
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".