How to add current UTC Time in MKV file metadata using ffmpeg? - ffmpeg

I am not sure if it's possible, but is there anyway we can add current UTC time inside the mkv metatag using ffmpeg? i read https://wiki.multimedia.cx/index.php?title=FFmpeg_Metadata but i could not find anything.
-metadata "Creation Time"="Need to add time tag/code"
output will show
Creation Time: UTC 2020-06-04 02:40:29

Related

How to append timecode into metadata using ffmpeg

We have a request to append output/timecode into metadata starting from frame 0.
It is done in nuke with addtimecode node, starting at frame 0 and timecode as 00:00:00:00 with a prefix of "output"
I'm trying to do it with ffmpeg but nto able to get it :(
I have tried with -metadata output/timecode="00:00:00:00" It didn't work
Metadata fields are dependent on your output format.

How to add telemetry data from a video to jpg file?

I have a 360deg video that is created by Go Pro Fusion and has telemetry data in it. I want to extract the telemetry data and put inside of jpg file.
I am extracting images using ffmpeg:
ffmpeg -i VIDEO.mp4 -r 5 img%d.jpg
How can i extract metadata(including telemetry data) for each frame and put that metadata inside jpg image of that frame.
I tried using
exiftool -ee -a -u -U -TagsFromFile video.mp4 img1.jpg
But all the metadata that appear in video does not appear in image.
I tried this:
exiftool -track1:VideoFrameRate=29.97 img1.jpg
But getting this warning:
Warning: Sorry, Track1:VideoFrameRate doesn't exist or isn't writable
Nothing to do.
<Track1:VideoFrameRate>20.00</Track1:VideoFrameRate>
I get this from video. But unable to set in jpg as mentioned above.
And how to ensure that the images are assigned with the exact GPS data?

FFMPEG Webvtt m3u8 download into single vtt file, ignore the "X-TIMESTAMP-MAP=MPEGTS=" (timestamp sync problem)

I want to download the subtitle of a video, it has separated m3u8 file for subtitle:
webvtt source in m3u8 format: https://sdn-global-streaming-cache.3qsdn.com/9378/files/19/05/1199332/Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes.ism/Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000.m3u8
looks like:
#EXTM3U
#EXT-X-VERSION:4
## Created with Unified Streaming Platform(version=1.9.5)
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-MEDIA-SEQUENCE:1
#EXT-X-INDEPENDENT-SEGMENTS
#EXT-X-TARGETDURATION:989
#USP-X-TIMESTAMP-MAP:MPEGTS=900000,LOCAL=1970-01-01T00:00:00Z
#EXTINF:24.72, no desc
Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000-1.webvtt
#EXTINF:2.56, no desc
Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000-13.webvtt
#EXTINF:50.88, no desc
Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000-14.webvtt
#EXTINF:3.079, no desc
Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000-40.webvtt
#EXTINF:60.401, no desc
....
Then use the command to download the multiple webvtts into one vtt file "EN.vtt":
ffmpeg -i "https://sdn-global-streaming-cache.3qsdn.com/9378/files/19/05/1199332/Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes.ism/Dqt6jZBkvX2nLyY4CGhxmpK89PbQRFV7-drm-aes-textstream_deu=1000.m3u8" "DE.vtt"
In output "DE.vtt" the X-TIMESTAMP-MAP=MPEGTS:xxxxxx,LOCAL:00:00:00.000 from each webvtt file (webvtt in m3u8) are ignored.
so that the time Synchronisation is broken, the start time of each Segment always begins from 00:00:00, looks like:
WEBVTT
00:00.000 --> 00:02.560
So viel Macht.
00:00.000 --> 00:03.079
Was er sagte.
00:00.000 --> 00:04.680
oder
die Schönheit
00:00.000 --> 00:01.440
Er sagte immer:
00:00.000 --> 00:03.840
Auf seinen Klang
00:00.000 --> 00:07.519
Seine Paranoia.
Could ffmpeg support the relative time stamp to convert into absolute time stamp?
Or use other method to download perfect webvvt file?
All i could find was this very old patch that has never been merged into FFmpeg: https://patchwork.ffmpeg.org/project/ffmpeg/patch/20170205194344.333-1-franklinphillips#gmx.com/
I edited it a little bit and applied it to the current ffmpeg source code, recompiled and successfully converted some webVTT subtitles served via HLS with X-TIMESTAMP-MAP tags.
This is the patch i finally used: https://gist.github.com/SebiderSushi/bdf8d46d5501f7085d0b27d8a19eb12c
Edit:
There is an open ticket on the FFmpeg issue tracker about this: https://trac.ffmpeg.org/ticket/8825

Using FFMPEG I get an error when trying to insert a fade after about 35 mins in a long video - is this possible?

I have a source video that is an hour long from which I want to extract a couple of minutes towards the end and add a video fade in at the start of the cropped section.
Using FFMPEG, I'm specifying the following command:
ffmpeg -i MyLongVideo.mp4 -q:v 0 -y -ss 00:50:00.000 -to 00:52:00.000 -vf "fade=t=in:st=3000.0:d=1.0, scale=iw*min(1280/iw\,720/ih):ih*min(1280/iw\,720/ih),pad=1280:720:(1280-iw)/2:(720-ih)/2" ./testoutput.ts
This is intended to crop from the source video from 50:00.000 to 52:00.00 and fade in from the 50th minute for 0.5 seconds (so at 3000 seconds in - st=3000.0).
This command that we build programmatically, works on shorter videos or when you crop from before about 35 minutes. For this longer video though I get an error that says:
[fade # 0000025399981e80] Value 3000.000000 for parameter 'st' out of range [0 - 2147.48]
The 2147.48 is around the 35 minutes in seconds which explains why this command works for shorter videos or on crops earlier than 35 minutes.
I've seen a number of other issues with FFMPEG talking about this 'magic' 2147.48 number with parameter values. Is this some sort of hard limit?
Is there a way to do what I want to do? I could do this in two passes - extract the section of video and then add the fade, but I'd rather do it in one command if possible - and it works for shorter/earlier crops.
Get a ffmpeg build from after Nov 12 2018 or before Oct 7 2018. There was a regression in the builds in between.

Transfer custom (all) metadata using ffmpeg

How to transfer metadata using FFMPEG or other tools with CMD ?
I'm trying to encode video/audio and since they already have metadata inside obviously i want to preserve them into my new file
btw since i'm using mediamonkey as main player, there's also some Custom metadata. this is the one who wont transfer
for Video output file using mp4/mkv (using x264)
for Audio output file using m4a (using neroAac)
Thank You!
ps. which container is best for neroAac and x264? since i can't seem to edit mkv metadata (when i remove from mediamonkey playlist, they're all gone), mp4 is fine though and i can't seem to play AAC, although it's fine when muxed into video
Copy all custom and global metadata tag information using the following command:
ffmpeg <inputfile> -movflags use_metadata_tags -c copy <outputfile>

Resources