Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
22nd February 2024, 01:13 | #1 | Link |
Registered User
Join Date: Sep 2022
Location: China
Posts: 23
|
How to add a time code to H264
How to add a time code to H264
Time code of first frame: 01:00:00:00
I don't know how to add a time code? |
23rd February 2024, 15:15 | #4 | Link | ||
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Ah okay, so set simply changes the first time code not set this info.
What do you get if you call: Quote:
If it includes the info you can probably use '-metadata' option in ffmpeg to set the info. Quote:
Code:
Other ID : 3 Type : Time code Format : QuickTime TC Duration : 160 ms Frame rate : 25.000 FPS Time code of first frame : 01:00:00:00 Time code of last frame : 01:00:00:03 Time code, stripped : Yes Language : English Encoded date : 2016-01-18 21:44:55 UTC Tagged date : 2016-01-18 21:44:55 UTC Last edited by Selur; 23rd February 2024 at 15:18. |
||
23rd February 2024, 15:30 | #5 | Link |
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
I tried:
Code:
ffmpeg -y -i "g:\TestClips&Co\files\5000frames.mp4" -timecode 01:02:03.04 -c copy g:\Output\test.mkv Code:
General Unique ID : 53443209611799196111184538750715928172 (0x2834C9AB657FEA584932404B99939E6C) Complete name : g:\Output\test.mkv Format : Matroska Format version : Version 4 File size : 799 KiB Duration : 3 min 20 s Overall bit rate : 32.7 kb/s Frame rate : 25.000 FPS Writing application : Lavf60.20.100 Writing library : Lavf60.20.100 ErrorDetectionType : Per level 1 Time code of first frame : 01:02:03.04 Time code source : Matroska tags Video ID : 1 Format : HEVC Format/Info : High Efficiency Video Coding Format profile : Main 10@L4.1@Main Codec ID : V_MPEGH/ISO/HEVC Duration : 3 min 20 s Bit rate : 32.1 kb/s Width : 640 pixels Height : 480 pixels Display aspect ratio : 4:3 Frame rate mode : Constant Frame rate : 25.000 FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 10 bits Bits/(Pixel*Frame) : 0.004 Stream size : 784 KiB (98%) Writing library : x265 2.6+22-ff02513b92c0:[Windows][GCC 7.2.0][64 bit] 10bit Encoding settings : cpuid=1173503 / frame-threads=4 / numa-pools=16 / wpp / no-pmode / no-pme / no-psnr / no-ssim / log-level=2 / input-csp=1 / input-res=640x480 / interlace=0 / total-frames=0 / level-idc=41 / high-tier=0 / uhd-bd=0 / ref=3 / no-allow-non-conformance / no-repeat-headers / annexb / no-aud / no-hrd / info / hash=0 / no-temporal-layers / no-open-gop / min-keyint=25 / keyint=250 / gop-lookahead=0 / bframes=4 / b-adapt=2 / b-pyramid / bframe-bias=0 / rc-lookahead=20 / lookahead-slices=0 / scenecut=40 / radl=0 / no-intra-refresh / ctu=64 / min-cu-size=8 / no-rect / no-amp / max-tu-size=32 / tu-inter-depth=1 / tu-intra-depth=1 / limit-tu=0 / rdoq-level=2 / dynamic-rd=0.00 / no-ssim-rd / signhide / no-tskip / nr-intra=0 / nr-inter=0 / no-constrained-intra / strong-intra-smoothing / max-merge=2 / limit-refs=3 / limit-modes / me=1 / subme=2 / merange=57 / temporal-mvp / weightp / no-weightb / no-analyze-src-pics / deblock=-1:-1 / sao / no-sao-non-deblock / rd=3 / no-early-skip / rskip / no-fast-intra / no-tskip-fast / no-cu-lossless / no-b-intra / no-splitrd-skip / rdpenalty=0 / psy-rd=2.50 / psy-rdoq=10.00 / no-rd-refine / no-lossless / cbqpoffs=-2 / crqpoffs=-2 / rc=crf / crf=18.0 / qcomp=0.60 / qpstep=4 / stats-write=0 / stats-read=0 / vbv-maxrate=20000 / vbv-bufsize=20000 / vbv-init=0.9 / crf-max=0.0 / crf-min=0.0 / ipratio=1.40 / pbratio=1.30 / aq-mode=1 / aq-strength=0.00 / cutree / zone-count=0 / no-strict-cbr / qg-size=8 / no-rc-grain / qpmax=69 / qpmin=0 / no-const-vbv / sar=0 / overscan=0 / videoformat=5 / range=0 / colorprim=2 / transfer=2 / colormatrix=5 / chromaloc=0 / display-window=0 / max-cll=0,0 / min-luma=0 / max-luma=1023 / log2-max-poc-lsb=8 / vui-timing-info / vui-hrd-info / slices=1 / no-opt-qp-pps / no-opt-ref-list-length-pps / no-multi-pass-opt-rps / scenecut-bias=0.05 / no-opt-cu-delta-qp / no-aq-motion / no-hdr / no-hdr-opt / no-dhdr10-opt / analysis-save=(null) / analysis-load=(null) / analysis-reuse-level=5 / scale-factor=0 / refine-intra=0 / refine-inter=0 / refine-mv=0 / limit-sao / ctu-info=0 / no-lowpass-dct / refine-mv-type=0 / copy-pic=1 Default : Yes Forced : No Color range : Limited Matrix coefficients : BT.470 System B/G VENDOR_ID : [0][0][0][0] |
24th February 2024, 07:43 | #6 | Link | |
Registered User
Join Date: Sep 2022
Location: China
Posts: 23
|
Quote:
Thank you for your the previous answer So how does below H264 RAW file generate the time code (Time code of first frame : 01:00:00:00) parameter? This is the H264 RAW file https://drive.google.com/file/d/1DH_...usp=drive_link If want to solve the problem Container encapsulated time code parameters It is not advisable But rather, the time code parameters need to be included in the RAW video file This is the main problem Or perhaps the H264 RAW file of FFmpeg does not support the time code parameter at all (Time code of first frame: 01:00:00:00) Last edited by KSSW; 24th February 2024 at 08:59. |
|
24th February 2024, 08:44 | #7 | Link |
Registered User
Join Date: Dec 2013
Posts: 343
|
Disclaimer: I have not looked at the example raw h.264 stream.
There can be a time code in the picture timing SEI message in H.264. It can contain hours:minutes:seconds:frames. How you get x264 to write such a timecode to the picture timing SEI I do not know. |
24th February 2024, 08:57 | #8 | Link | |
Registered User
Join Date: Sep 2022
Location: China
Posts: 23
|
Quote:
This is the H264 RAW file https://drive.google.com/file/d/1DH_...usp=drive_link Last edited by KSSW; 24th February 2024 at 09:01. |
|
24th February 2024, 17:46 | #11 | Link |
Registered User
Join Date: May 2023
Posts: 23
|
Here is what x264 source says about it:
Code:
// These clock timestamps are not standardised so we don't set them // They could be time of origin, capture or alternative ideal display for( int i = 0; i < num_clock_ts[h->fenc->i_pic_struct]; i++ ) bs_write1( &q, 0 ); // clock_timestamp_flag |
Thread Tools | Search this Thread |
Display Modes | |
|
|