FFMPEG save AVI's Recorded date metadata to MP4 Tagged Date?

0

I'm converting my old DV tapes from AVI files to MP4 format. Is there a way to transfer AVI's "RECORDED DATE" to MP4's "TAGGED DATE"?

I plan to do this in batch so I was hoping to automate it but it's been frustrating to me figuring out how to get it to work. What I've figured out so far is that AVI's store the date and time in ICRD=2001-04-29 11:27:04 If anyone can help me I would be very grateful.

I am using Windows and am writing and writing the command in a bat file:

ffmpeg -i "in.avi" -vf yadif -c:v libx264 -preset slow -crf 18 -c:a aac -b:a 128k
-movflags metadata ICRD -metadata tagged_date
"out.mp4"
General
Complete name               : E:\VideoCapture\2001_04_29 11_27_04Z.avi
Format                      : AVI
Format/Info                 : Audio Video Interleave
Commercial name             : DVCPRO
File size                   : 133 MiB
Duration                    : 36 s 668 ms
Overall bit rate mode       : Constant
Overall bit rate            : 30.3 Mb/s
Recorded date               : UTC 2001-04-29 11:27:04
General
Complete name               : E:\2001_04_29 11_27_04.mp4
Format                      : MPEG-4
Format profile              : Base Media / Version 2
Codec ID                    : mp42 (isom/iso2/avc1/mp41)
File size                   : 46.8 MiB
Duration                    : 36 s 672 ms
Overall bit rate            : 10.7 Mb/s
Encoded date                : UTC 2020-01-23 01:33:14
Tagged date                 : UTC 2020-01-23 01:33:14
Writing application         : HandBrake 1.3.1 2020010400

Mykie Yatco

Posted 2020-01-23T11:37:17.707

Reputation: 1

1

I learned from this page that I can map custom metadata on mp4 wrappers https://superuser.com/questions/1208273/add-new-and-non-defined-metadata-to-a-mp4-file In my understanding, I should be able to transfer the ICRD tag once I have a matching ICRD tag destination in the mp4 file. I will try using -map_metadata 0 and see what happens.

– Mykie Yatco – 2020-01-23T11:46:50.307

Answers

0

You can use ffprobe to get the date metadata:

$ ffprobe -v error -show_entries format_tags=date -of csv=p=0 in.avi
  2001-04-29T11:27:04Z
  • I'm guessing this is the ISO 8601 format of your date: it may be slightly different, but it should still work.

Then use that in your ffmpeg command:

ffmpeg -i "in.avi" -vf "yadif,format=yuv420p" -c:v libx264 -preset slow -crf 18 -c:a aac -b:a 128k -movflags +faststart -metadata creation_time="2001-04-29T11:27:04Z" "out.mp4"
  • Using -metadata creation_time will be shown as Encoded date and Tagged date in mediainfo for MP4 files.

  • This can of course be scripted, or depending on your OS/scripting language/shell you can embed the ffprobe command in your ffmpeg command.

llogan

Posted 2020-01-23T11:37:17.707

Reputation: 31 929