mikem
mikem

Reputation: 121

get specific metadata with ffprobe

I'm having a terrible time getting one single line of metadata from ffprobe.

I'm running this command:

ffprobe -show_entries 'stream_tags : format_tags=com.apple.quicktime.creationdate' -loglevel error IMG_9931.MOV

And I get this output

[STREAM]

TAG:creation_time=2022-05-14T20:24:55.000000Z

TAG:language=und

TAG:handler_name=Core Media Video

TAG:encoder=H.264

[/STREAM]

[STREAM]

TAG:creation_time=2022-05-14T20:24:55.000000Z

TAG:language=und

TAG:handler_name=Core Media Audio

[/STREAM]

[STREAM]

TAG:creation_time=2022-05-14T20:24:55.000000Z

TAG:language=und

TAG:handler_name=Core Media Metadata

[/STREAM]

[STREAM]

TAG:creation_time=2022-05-14T20:24:55.000000Z

TAG:language=und

TAG:handler_name=Core Media Metadata

[/STREAM]

[STREAM]

TAG:creation_time=2022-05-14T20:24:55.000000Z

TAG:language=und

TAG:handler_name=Core Media Metadata

[/STREAM]

[FORMAT]

TAG:com.apple.quicktime.creationdate=2022-05-14T16:24:55-0400

[/FORMAT]

But the only thing I want returned is

com.apple.quicktime.creationdate=2022-05-14T16:24:55-0400

I've searched and searched but I can't find any examples of pulling a single specific value of metadata.

In actuality, I really just want the value of com.apple.quicktime.creationdate... ie "2022-05-14T16:24:55-0400"

I know I can grep and awk my way through it, but it seems like there should be a way to do it with ffprobe alone given all of the options it has. I just can't figure out how.

How can I do this? Any help would be appreciated.

Upvotes: 1

Views: 7004

Answers (1)

RARE Kpop Manifesto
RARE Kpop Manifesto

Reputation: 2865

have you tried

ffprobe -show_entries format_tags=com.apple.quicktime.creationdate -i file.mov

@OP : no idea why the tags are still showing up for u

ffprobe -v 0 -show_entries format -i'………/mnetMSTR_MV_00137_1.mp4' -of default=nk=0:nw=0

[FORMAT]
filename=………/mnetMSTR_MV_00137_1.mp4
nb_streams=4
nb_programs=0
format_name=mov,mp4,m4a,3gp,3g2,mj2
format_long_name=QuickTime / MOV
start_time=0.000000
duration=241.984000
size=77126839
bit_rate=2549816
probe_score=100
TAG:major_brand=isom
TAG:minor_version=512
TAG:compatible_brands=isomiso2avc1mp41
TAG:title=Passion (mnet-137) 384p
TAG:artist=Koyote 코요태 KYT✜ 高耀太
TAG:album=2000 ▸ Passion
TAG:date=2000
TAG:encoder=Lavf58.45.100
TAG:comment=mnet MV ▸ 137 ▸ 4:02·b2906·g0102 ▸ master mp4

trk 2 : aac 384k, vol normalized :
loudnorm=-11:7:-2:-11.49:5.30:1.59:-21.74:0.71:true:true:summary

trk 4 : orig aac, preserved losslessly

TAG:genre=Kpop
TAG:lyrics=It's on and bump it
It's on and bump it
It's on and bump it
get ready to ride yeah!

It's on and bump it baby
come on and bump it baby
It's on and bump it baby
come on and bump it baby

people in the house lets go

아련히 기억에 멀어지던
너를 다시 볼수 있어 행복했었어
하지만 나 멀리서 너만을
하염없이 보고 말았지

once i flip those 2 to -of default=nk=1:nw=1 - everything gone except the raw values themselves

(there's no way in heck I could manage 40,000 MVs and 9900 songs with proper metadata for all without awk)

filename=………/mnetMSTR_MV_00137_1.mp4
4
0
mov,mp4,m4a,3gp,3g2,mj2
QuickTime / MOV
0.000000
241.984000
77126839
2549816
100
isom
512
isomiso2avc1mp41
Passion (mnet-137) 384p
Koyote 코요태 KYT✜ 高耀太
2000 ▸ Passion
2000
Lavf58.45.100
mnet MV ▸ 137 ▸ 4:02·b2906·g0102 ▸ master mp4

trk 2 : aac 384k, vol normalized :
loudnorm=-11:7:-2:-11.49:5.30:1.59:-21.74:0.71:true:true:summary

trk 4 : orig aac, preserved losslessly

Kpop
It's on and bump it
It's on and bump it
It's on and bump it
get ready to ride yeah!

It's on and bump it baby
come on and bump it baby
It's on and bump it baby
come on and bump it baby

people in the house lets go

아련히 기억에 멀어지던
너를 다시 볼수 있어 행복했었어
하지만 나 멀리서 너만을
하염없이 보고 말았지

==========

ffprobe version 5.1 Copyright (c) 2007-2022 the FFmpeg developers
  built with Apple clang version 13.1.6 (clang-1316.0.21.2.5)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.1-with-options_1 …..
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100

Upvotes: 3

Related Questions