UnityPlugin-AVProVideo
UnityPlugin-AVProVideo copied to clipboard
Support for timed metadata
Users would benefit from us supporting timed metadata for doing things such as syncing streams
Hi we are currently using ffmpeg to inject TIMECODE SIDE_DATA into a video stream, if you use ffprobe on a video stream that contained such information you would see something like this for each frame:
ffprobe some_video.mp4 -select_streams v:0 -show_frames
[FRAME] media_type=video stream_index=0 key_frame=0 pkt_pts=321358255 pkt_pts_time=3570.647278 pkt_dts=321358255 pkt_dts_time=3570.647278 best_effort_timestamp=321358255 best_effort_timestamp_time=3570.647278 pkt_duration=3003 pkt_duration_time=0.033367 pkt_pos=362840 pkt_size=17563 width=4096 height=2048 pix_fmt=yuv420p sample_aspect_ratio=1:1 pict_type=P coded_picture_number=0 display_picture_number=0 interlaced_frame=0 top_field_first=0 repeat_pict=0 color_range=tv color_space=bt709 color_primaries=bt709 color_transfer=bt709 chroma_location=left TAG:timecode=22:22:22;22 [SIDE_DATA] side_data_type=SMPTE 12-1 timecode [TIMECODE] value=11:07:23;10 [/TIMECODE] [TIMECODE] value=11:07:24;05 [/TIMECODE] [TIMECODE] value=22:22:22;22 [/TIMECODE] [/SIDE_DATA] [/FRAME]
This is obviosity very useful for synchronising live video from different sources.
With synced metadata we can also trigger scripted events all over the place at very specific times. I'm currently using the subtitles for this, it works but it's uber hacky and fragile.