Select(x => Convert.ToByte(hex.Substring(x, 2), 16))
for (int i = 0 i (file, moovPosition - 4, 4).Reverse().ToArray(), 0) īyte moovBytes = BitConverter.GetBytes(moovLength + metadata.Length).Reverse().ToArray() įor (int i = 0 i (file, stcoPosition + 8, 4).Reverse().ToArray(), 0) įor (int a = stcoPosition + 12 a (file, a, 4).Reverse().ToArray(), 0) īyte newEntry = BitConverter.GetBytes(entryLength + metadata.Length).Reverse().ToArray()
byte trakBytes = BitConverter.GetBytes(trakLength + metadata.Length).Reverse().ToArray() I tried method but I must be doing something wrong because the output file is unplayable. I then tried to use this command but it didn't work: ffmpeg -i chapmanspeak.mp4 -movflags use_metadata_tags -metadata side_metadata_type="Spherical Mapping" -metadata projection=equirectangular -metadata yaw=0 -metadata pitch=0 -metadata roll=0 -codec copy output.mp4 Edit 6 This was the logs it outputted: TAG:handler_name=VideoHandler I also tried to get the metadata using this command: ffprobe -v error -select_streams v:0 -show_streams -of default=noprint_wrappers=1 injected.mp4 This is the output of the log: fps, 60 tbr, 15360 tbn, 120 tbc (default) This was the command I used: ffmpeg -i injected.mp4 -map_metadata -1 -f ffmetadata data.txt When I extract the metadata using ffmpeg it contains the spherical tag in the logs but not when I output it to a ffmetadata file. I think the issue with the ffmpeg method is that it does not contain the rdf:SphericalVideo part which allows the spherical video tags to be used. I've also tried to do it with ffmpeg like so: ffmpeg -i input.mp4 -movflags use_metadata_tags -metadata Spherical=true -metadata Stitched=true -metadata ProjectionType=equirectangular -metadata StitchingSoftware=StreetviewJourney -codec copy output.mp4 This is the metadata injected by Google's Spatial Media Tool which is what I am trying to achieve: truetrueSpherical Metadata Toolequirectangular` I have tried just pasting in the metadata into the correct place in the file, just in case it might work, but it didn't. The problem is I know zero python whatsoever so I'm leaning towards a library/nuget package/ffmpeg script.ĭoes a good nuget package/library exist that can do this or should I go for the alternative option? Edit 1 The alternative I found was to use Spatial Media as a command line application to inject the metadata more easily. I spent some time looking around for libraries that can do this but could only find ones for extracting metadata not injecting/embedding/writing it. I know what metadata needs to be injected I just do not know how to inject it. mp4 file to allow the video to be displayed correctly as a 360 video. I'm working on a library that injects metadata into a.