How Can I Copy Encoder and Metadata from Another Video

Viewed 51

I have a video, generated with Opencv. I want make video metadata and encoder settings like another video. How can I make it ?

My video:
ffmpeg output:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output/fixed.mp4':
Metadata:
compatible_brands: isommp42
major_brand : mp42
minor_version : 0
creation_time : 2022-03-03T19:12:13.000000Z
com.android.version: 11
encoder : Lavf59.16.100
Duration: 00:00:06.00, start: 0.000000, bitrate: 6683 kb/s
Stream #0:00x1: Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(progressive), 640x480 [SAR 1:1 DAR 4:3], 6681 kb/s, 30.03 fps, 30.03 tbr, 30030 tbn (default)
Metadata:
creation_time : 2022-03-03T19:12:13.000000Z
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of 90.00 degrees

Media Info output:

General
Complete name : fixed.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/avc1/mp41)
File size : 4.78 MiB
Duration : 5 s 995 ms
Overall bit rate : 6 683 kb/s
Encoded date : UTC 2022-03-03 19:12:13
Tagged date : UTC 2022-03-03 19:12:13

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3
Format settings : 1 Ref Frames
Format settings, CABAC : No
Format settings, Reference frames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 5 s 995 ms
Bit rate : 6 682 kb/s
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Rotation : 270°
Frame rate mode : Constant
Frame rate : 30.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.725
Stream size : 4.77 MiB (100%)
Encoded date : UTC 2022-03-03 19:12:13
Tagged date : UTC 2022-03-03 19:12:13
Codec configuration box : avcC

I want change it like this:
ffmpeg output:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'output/source_encoder/video.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: isommp42
creation_time : 2022-03-03T19:12:13.000000Z
com.android.version: 11
Duration: 00:00:04.83, start: 0.000000, bitrate: 1020 kb/s
Stream #0:00x1: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 640x480, 1016 kb/s, SAR 1:1 DAR 4:3, 30.03 fps, 30 tbr, 90k tbn (default)
Metadata:
creation_time : 2022-03-03T19:12:13.000000Z
handler_name : VideoHandle
vendor_id : [0][0][0][0]
Side data:
displaymatrix: rotation of 90.00 degrees

Media Info Output:

General
Complete name : source_encoder/video.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (isom/mp42)
File size : 601 KiB
Duration : 4 s 828 ms
Overall bit rate : 1 020 kb/s
Encoded date : UTC 2022-03-03 19:12:13
Tagged date : UTC 2022-03-03 19:12:13
com.android.version : 11

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3
Format settings : CABAC / 1 Ref Frames
Format settings, CABAC : Yes
Format settings, Reference frames : 1 frame
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 4 s 828 ms
Bit rate : 1 016 kb/s
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Rotation : 270°
Frame rate mode : Variable
Frame rate : 30.000 FPS
Minimum frame rate : 30.000 FPS
Maximum frame rate : 30.060 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.110
Stream size : 599 KiB (100%)
Title : VideoHandle
Language : English
Encoded date : UTC 2022-03-03 19:12:13
Tagged date : UTC 2022-03-03 19:12:13
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
mdhd_Duration : 4828
Codec configuration box : avcC

0 Answers
Related