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. |
3rd October 2021, 16:16 | #1 | Link |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
Change AVC timestamp
Hi,
Is there a way (tool) to change/alter a raw AVC timestamp? For example, x264 encodes, as far as I know, always starts at 00:00:00:00 but there are times where there's a need to a custom timestamp (i.e. for adding subtitles at authoring stage when segmenting-encoding). Maybe this could be very helpful feature to add as a parameter inside x264, but, in the meantime, is there a tool that can edit this without loosing compliancy (for bluray). Thanks, |
3rd October 2021, 20:35 | #2 | Link |
Registered User
Join Date: Jul 2007
Posts: 552
|
Raw H.264 doesn't have timestamps in stream (let's ignore picture timing SEI as clock timestamps there are not standardized and x264 doesn't write them). Raw H.264 at maximum have fps (timebase) in VUI. All timestamps are added at container (MP4/MKV) level so you can use any tool for needed container that allow mux with timestamps (like --tcfile-in in x264).
|
3rd October 2021, 21:33 | #3 | Link |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
Mhmm there should be something else anyway ("timecode"?), because other bluray encoders allows to "write" an initial TC and once the raw file is outputted, Scenarist (for example) read that TC just fine... and the file surely is raw and not in a container (since Scenarist works only with elementary stream). But this can be seen even on lots of commercial blurays out there. Once demuxed, the raw .264 file have embedded TC. That's what I would like to achieve...
|
3rd October 2021, 23:08 | #5 | Link |
Registered User
Join Date: Jul 2003
Location: Italy
Posts: 1,135
|
Yeah, absolutely. It's a raw .264 file, no container at all.
Edit: Don't know if this can be helpful, but that's the header of this raw .264 file that starts at 01:00:10:00 (1hour and ten seconds): I guess that's probably what you were referring to picture timing SEI... but could be extremely helpful at authoring stage. Last edited by mp3dom; 3rd October 2021 at 23:39. |
5th October 2021, 12:03 | #6 | Link | |
Registered User
Join Date: Feb 2020
Posts: 539
|
Quote:
|
|
5th October 2021, 22:43 | #7 | Link | |||
Registered User
Join Date: Jul 2007
Posts: 552
|
Quote:
Quote:
Quote:
|
|||
6th October 2021, 21:22 | #9 | Link |
Registered User
Join Date: Jul 2007
Posts: 552
|
Few short (200~500 frames) samples would be good to understand what other encoders do (preferably few different encoders to make sure that they agree between themself) to mimic their behavior. There should be progressive streams, interlaced streams and streams with soft pulldown. What do encoders take from user as input for this timestamps (timestamps for every frame? only starting offset? and at what precision? hh:mm:ss or also ms?).
|
15th October 2021, 15:44 | #11 | Link |
Registered User
Join Date: Feb 2020
Posts: 539
|
Well, the first file has
Code:
[trace_headers @ 00000227afa6cd80] 111 timing_info_present_flag 1 = 1 [trace_headers @ 00000227afa6cd80] 112 num_units_in_tick 00000000000000000000001111101001 = 1001 [trace_headers @ 00000227afa6cd80] 144 time_scale 00000000000000001011101110000000 = 48000 [trace_headers @ 00000227afa6cd80] 176 fixed_frame_rate_flag 1 = 1 Code:
[trace_headers @ 00000227afa6cd80] Picture Timing [trace_headers @ 00000227afa6cd80] 24 cpb_removal_delay 000000000000010100 = 20 [trace_headers @ 00000227afa6cd80] 42 dpb_output_delay 000000 = 0 [trace_headers @ 00000227afa6cd80] 48 pic_struct 0000 = 0 [trace_headers @ 00000227afa6cd80] 52 clock_timestamp_flag[0] 1 = 1 [trace_headers @ 00000227afa6cd80] 53 ct_type 00 = 0 [trace_headers @ 00000227afa6cd80] 55 nuit_field_based_flag 1 = 1 [trace_headers @ 00000227afa6cd80] 56 counting_type 00001 = 1 [trace_headers @ 00000227afa6cd80] 61 full_timestamp_flag 0 = 0 [trace_headers @ 00000227afa6cd80] 62 discontinuity_flag 0 = 0 [trace_headers @ 00000227afa6cd80] 63 cnt_dropped_flag 0 = 0 [trace_headers @ 00000227afa6cd80] 64 n_frames 00001011 = 11 [trace_headers @ 00000227afa6cd80] 72 seconds_flag 1 = 1 [trace_headers @ 00000227afa6cd80] 73 seconds_value 000011 = 3 [trace_headers @ 00000227afa6cd80] 79 minutes_flag 1 = 1 [trace_headers @ 00000227afa6cd80] 80 minutes_value 000000 = 0 [trace_headers @ 00000227afa6cd80] 86 hours_flag 1 = 1 [trace_headers @ 00000227afa6cd80] 87 hours_value 00001 = 1 [trace_headers @ 00000227afa6cd80] 92 time_offset 000000000000000000000000 = 0 [trace_headers @ 00000227afa6cd80] 116 bit_equal_to_one 1 = 1 [trace_headers @ 00000227afa6cd80] 117 bit_equal_to_zero 0 = 0 [trace_headers @ 00000227afa6cd80] 118 bit_equal_to_zero 0 = 0 [trace_headers @ 00000227afa6cd80] 119 bit_equal_to_zero 0 = 0 [trace_headers @ 00000227afa6cd80] 120 rbsp_stop_one_bit 1 = 1 [trace_headers @ 00000227afa6cd80] 121 rbsp_alignment_zero_bit 0 = 0 [trace_headers @ 00000227afa6cd80] 122 rbsp_alignment_zero_bit 0 = 0 [trace_headers @ 00000227afa6cd80] 123 rbsp_alignment_zero_bit 0 = 0 [trace_headers @ 00000227afa6cd80] 124 rbsp_alignment_zero_bit 0 = 0 [trace_headers @ 00000227afa6cd80] 125 rbsp_alignment_zero_bit 0 = 0 [trace_headers @ 00000227afa6cd80] 126 rbsp_alignment_zero_bit 0 = 0 [trace_headers @ 00000227afa6cd80] 127 rbsp_alignment_zero_bit 0 = 0 Last edited by Balling; 16th October 2021 at 03:04. |
22nd October 2021, 20:33 | #13 | Link |
Registered User
Join Date: Feb 2020
Posts: 539
|
Actually yes. Looking into commits timing sei IS supported by ffmpeg. For a long time. I am not sure it is flawless, everything else is not in ffmpeg after all. Like for example eac3 that does not write correct media duration in editlist, only media time. Not that media duration even works even if written correctly.
Last edited by Balling; 22nd October 2021 at 20:35. |
29th October 2021, 18:17 | #14 | Link | |
Moderator
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
|
Quote:
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|