how to write stream level metadata

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how to write stream level metadata

Rama Krishna Thelagathoti
Hello ffmpeg team

My objective is to append 360 degree spherical metadata to the video stream
with a mainstream. Following is the metadata I want to write
side_metadata_type="Spherical Mapping"
projection=equirectangular
yaw=0
pitch=0
roll=0

I tried the following command, but this doesn't work. I don't see metadata
being added to video stream.

 ffmpeg -loglevel info -i R0010309_er.MP4 -map 0:v -vcodec libx264
 -vprofile high -metadata:s:v:0 side_metadata_type="Spherical Mapping"
-metadata:s:v:0 projection=equirectangular -metadata:s:v:0 yaw=0
 -metadata:s:v:0 pitch=0 -metadata:s:v:0 roll=0 -map 0:a -acodec aac -f mp4
 metachange.mp4
[ R0010309_er.MP4 is 360 degree video which has 1 video and 1 audio stream]
, following is the console output

rthelagathoti@PKI369-NUC04:~/streaming$  ffmpeg -loglevel info -i
R0010309_er.MP4 -map 0:v -vcodec libx264  -vprofile high -metadata:s:v:0
side_metadata_type="Spherical Mapping" -metadata:s:v:0
projection=equirectangular -metadata:s:v:0 yaw=0  -metadata:s:v:0 pitch=0
-metadata:s:v:0 roll=0 -map 0:a -acodec aac -f mp4  metachange.mp4
ffmpeg version 4.2.2-1ubuntu1~18.04.york0 Copyright (c) 2000-2019 the
FFmpeg developers
  built with gcc 7 (Ubuntu 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version='1ubuntu1~18.04.york0'
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband
--enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex
--enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab
--enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp
--enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq
--enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl
--enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm
--enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r
--enable-libx264 --enable-shared
  libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'R0010309_er.MP4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    creation_time   : 2018-01-01T19:49:42.000000Z
  Duration: 00:00:03.57, start: 0.000000, bitrate: 62822 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 /
0x31637661), yuvj420p(pc), 3840x1920 [SAR 1:1 DAR 2:1], 59135 kb/s, 29.97
fps, 29.97 tbr, 29970 tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2018-01-01T19:49:42.000000Z
      handler_name    : VideoHandler
    Side data:
      spherical: equirectangular (0.000000/0.000000/0.000000)
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono,
fltp, 127 kb/s (default)
    Metadata:
      creation_time   : 2018-01-01T19:49:42.000000Z
      handler_name    : SoundHandler
File 'metachange.mp4' already exists. Overwrite ? [y/N] y
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[libx264 @ 0x5573abe38e00] using SAR=1/1
[libx264 @ 0x5573abe38e00] using cpu capabilities: MMX2 SSE2Fast SSSE3
SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x5573abe38e00] profile High, level 5.1
[libx264 @ 0x5573abe38e00] 264 - core 155 r2917 0a84d98 - H.264/MPEG-4 AVC
codec - Copyleft 2003-2018 - http://www.videolan.org/x264.html - options:
cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1
psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1
cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6
lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0
bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1
b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25
scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0
qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'metachange.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.29.100
    Stream #0:0(und): Video: h264 (libx264) (avc1 / 0x31637661),
yuvj420p(pc), 3840x1920 [SAR 1:1 DAR 2:1], q=-1--1, 29.97 fps, 11988 tbn,
29.97 tbc (default)
    Metadata:
      creation_time   : 2018-01-01T19:49:42.000000Z
      handler_name    : VideoHandler
      side_metadata_type: Spherical Mapping
      projection      : equirectangular
      yaw             : 0
      pitch           : 0
      roll            : 0
      encoder         : Lavc58.54.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
      spherical: equirectangular (0.000000/0.000000/0.000000)
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, mono,
fltp, 69 kb/s (default)
    Metadata:
      creation_time   : 2018-01-01T19:49:42.000000Z
      handler_name    : SoundHandler
      encoder         : Lavc58.54.100 aac
frame=  106 fps=3.9 q=-1.0 Lsize=    4891kB time=00:00:03.56
bitrate=11238.0kbits/s speed=0.132x
video:4855kB audio:30kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: 0.105744%
[libx264 @ 0x5573abe38e00] frame I:1     Avg QP:22.07  size:280593
[libx264 @ 0x5573abe38e00] frame P:27    Avg QP:21.59  size:101191
[libx264 @ 0x5573abe38e00] frame B:78    Avg QP:24.55  size: 25105
[libx264 @ 0x5573abe38e00] consecutive B-frames:  1.9%  0.0%  0.0% 98.1%
[libx264 @ 0x5573abe38e00] mb I  I16..4: 29.7% 55.2% 15.1%
[libx264 @ 0x5573abe38e00] mb P  I16..4: 11.1% 10.5%  0.2%  P16..4: 38.4%
 9.9%  5.6%  0.0%  0.0%    skip:24.3%
[libx264 @ 0x5573abe38e00] mb B  I16..4:  1.6%  1.1%  0.0%  B16..8: 38.7%
 1.8%  0.1%  direct: 2.0%  skip:54.7%  L0:48.8% L1:49.6% BI: 1.6%
[libx264 @ 0x5573abe38e00] 8x8 transform intra:46.9% inter:81.6%
[libx264 @ 0x5573abe38e00] coded y,uvDC,uvAC intra: 16.7% 40.6% 3.6% inter:
8.6% 14.1% 0.1%
[libx264 @ 0x5573abe38e00] i16 v,h,dc,p: 18% 51% 10% 21%
[libx264 @ 0x5573abe38e00] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 36% 41%  1%
 1%  1%  2%  1%  2%
[libx264 @ 0x5573abe38e00] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 32% 13%  5%
 7%  5% 10%  4%  8%
[libx264 @ 0x5573abe38e00] i8c dc,h,v,p: 51% 36% 10%  3%
[libx264 @ 0x5573abe38e00] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x5573abe38e00] ref P L0: 61.7%  9.8% 20.9%  7.5%
[libx264 @ 0x5573abe38e00] ref B L0: 89.3%  8.4%  2.3%
[libx264 @ 0x5573abe38e00] ref B L1: 94.0%  6.0%
[libx264 @ 0x5573abe38e00] kb/s:11243.69
[aac @ 0x5573abe3bf00] Qavg: 845.908
--
Best Regards
*Rama krishna Thelagathoti*
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".