Skip to content

Conversation

@foxPrateek
Copy link

Added DROP frame support

@foxPrateek foxPrateek requested a review from a team as a code owner August 27, 2025 22:15
@OlteanuRares
Copy link
Contributor

Thanks, this looks good.
Could you please remove the commented-out methods, run the Black code formatter, and add some tests?"

@foxPrateek
Copy link
Author

###############################################################################
TEST RUNS
##############################################################################
================================================================================================================================== short test summary info ==================================================================================================================================
PASSED tests/test_dfxp.py::TestDFXPReader::test_negative_answer_for_scc_on_pop_on
PASSED tests/test_microdvd.py::TestMicroDVDReader::test_negative_answer_for_detection_scc_pop_on
PASSED tests/test_sami.py::TestSAMIReader::test_negative_answer_for_detection_scc_pop_on
PASSED tests/test_scc.py::TestSCCReader::test_reader_only_supports_unicode_input
PASSED tests/test_scc.py::TestSCCReader::test_positive_answer_for_detection
PASSED tests/test_scc.py::TestSCCReader::test_negative_answer_for_detection_dfxp
PASSED tests/test_scc.py::TestSCCReader::test_negative_answer_for_detection_microdvd
PASSED tests/test_scc.py::TestSCCReader::test_negative_answer_for_detection_sami
PASSED tests/test_scc.py::TestSCCReader::test_negative_answer_for_detection_srt
PASSED tests/test_scc.py::TestSCCReader::test_negative_answer_for_detection_webvtt
PASSED tests/test_scc.py::TestSCCReader::test_caption_length
PASSED tests/test_scc.py::TestSCCReader::test_proper_timestamps
PASSED tests/test_scc.py::TestSCCReader::test_invalid_timestamps
PASSED tests/test_scc.py::TestSCCReader::test_empty_file
PASSED tests/test_scc.py::TestSCCReader::test_positioning
PASSED tests/test_scc.py::TestSCCReader::test_tab_offset
PASSED tests/test_scc.py::TestSCCReader::test_italics_are_properly_read
PASSED tests/test_scc.py::TestSCCReader::test_default_positioning_when_no_positioning_is_specified
PASSED tests/test_scc.py::TestSCCReader::test_timing_is_properly_set_on_split_captions
PASSED tests/test_scc.py::TestSCCReader::test_skip_extended_characters_ascii_duplicate
PASSED tests/test_scc.py::TestSCCReader::test_skip_duplicate_tab_offset
PASSED tests/test_scc.py::TestSCCReader::test_skip_duplicate_special_characters
PASSED tests/test_scc.py::TestSCCReader::test_flashing_cue
PASSED tests/test_scc.py::TestSCCReader::test_line_too_long
PASSED tests/test_scc.py::TestSCCReader::test_mid_row_codes_not_adding_space_before_text
PASSED tests/test_scc.py::TestSCCReader::test_mid_row_codes_adding_space_after_text_if_there_is_none_closing_style
PASSED tests/test_scc.py::TestSCCReader::test_mid_row_codes_adding_space_after_text_if_there_is_none_opening_style
PASSED tests/test_scc.py::TestSCCReader::test_mid_row_codes_not_adding_space_if_there_is_one_before
PASSED tests/test_scc.py::TestSCCReader::test_removing_spaces_at_end_of_lines
PASSED tests/test_scc.py::TestCoverageOnly::test_freeze_rollup_captions_contents
PASSED tests/test_scc.py::TestCoverageOnly::test_multiple_formats
PASSED tests/test_scc.py::TestCoverageOnly::test_freeze_semicolon_spec_time
PASSED tests/test_scc.py::TestCoverageOnly::test_freeze_colon_spec_time
PASSED tests/test_scc.py::TestInterpretableNodeCreator::test_italics_commands_are_formatted_properly
PASSED tests/test_scc.py::TestInterpretableNodeCreator::test_closing_italics_closing_on_style_change
PASSED tests/test_scc.py::TestInterpretableNodeCreator::test_remove_noon_off_on_italics
PASSED tests/test_scc.py::TestInterpretableNodeCreator::test_skip_redundant_italics_nodes
PASSED tests/test_scc.py::TestInterpretableNodeCreator::test_close_italics_before_repositioning
PASSED tests/test_scc.py::TestInterpretableNodeCreator::test_ensure_final_italics_node_closes
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_appending_then_appending
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_appending_then_extending
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_extending_then_appending
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_extending_then_extending
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_not_appending_none_or_empty_captions
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_not_extending_list_with_nones_or_empty_captions
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_not_overwriting_end_time
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_overwriting_end_time_difference_under_5_frames
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_last_caption_zero_end_time_is_corrected
PASSED tests/test_scc.py::TestTimingCorrectingCaptionList::test_eoc_first_command
PASSED tests/test_scc_conversion.py::TestSRTtoSCCtoSRT::test_srt_to_scc_to_srt_conversion
PASSED tests/test_scc_conversion.py::TestSCCtoDFXP::test_scc_to_dfxp
PASSED tests/test_scc_conversion.py::TestSCCtoDFXP::test_dfxp_is_valid_xml_when_scc_source_has_weird_italic_commands
PASSED tests/test_scc_conversion.py::TestSCCtoDFXP::test_dfxp_is_valid_xml_when_scc_source_has_ampersand_character
PASSED tests/test_scc_conversion.py::TestSCCToWebVTT::test_webvtt_newlines_are_properly_rendered
PASSED tests/test_scc_translator.py::TestSCCTranslator::test_successful_translation
PASSED tests/test_scc_translator.py::TestSCCTranslator::test_no_brackets
PASSED tests/test_scc_translator.py::TestSCCTranslator::test_custom_brackets
PASSED tests/test_scc_translator.py::TestSCCTranslator::test_commands_not_found
PASSED tests/test_scc_translator.py::TestSCCTranslator::test_special_and_extended_characters
PASSED tests/test_srt.py::TestSRTReader::test_negative_answer_for_detection_scc_pop_on
PASSED tests/test_webvtt.py::TestWebVTTReader::test_negative_answer_for_detection_scc_pop_on
====================================================================================================================== 61 passed, 206 deselected, 3 warnings in 1.65s ======================

#################################################################################################
VTT TO SCC TESTS
################################################################################################

Source VTT file :

WEBVTT

0
00:00:01.529 --> 00:00:03.640
When it comes to finding the one,

1
00:00:03.730 --> 00:00:07.239
I always say that if they can love you at your messiest,

2
00:00:07.570 --> 00:00:09.319
calm you at your moodiest,

3
00:00:09.529 --> 00:00:11.680
and laugh with you at your quirkiest,

4
00:00:11.930 --> 00:00:13.760
you've probably found your person.

5
00:00:13.970 --> 00:00:14.760
On today's case,

6
00:00:14.770 --> 00:00:15.060
Mr.

7
00:00:15.170 --> 00:00:19.579
Chapman says he thought he found the 13 years ago when he met Mr.

8
00:00:19.610 --> 00:00:19.889
Gordon.

9
00:00:20.194 --> 00:00:22.875
But now believes that must have all been a dream.

10
00:00:23.165 --> 00:00:23.405
Mr.

11
00:00:23.485 --> 00:00:25.915
Chapman says now that he's finally awake,

With Drop Frame Enabled :
#######################################
writer = make_scc_writer(args.fps, drop_frame=True)
scc_text = converter.write(writer)

##################################################
Scenarist_SCC V1.0

00:00:00;18 94ae 94ae 9420 9420 94d0 5768 e56e 20e9 f420 e3ef 6de5 7320 f4ef 20e6 e96e 64e9 6e67 20f4 68e5 9470 ef6e e52c 942f 942f

00:00:02;12 94ae 94ae 9420 9420 94d0 4920 61ec f761 7973 2073 6179 20f4 6861 f420 e9e6 20f4 68e5 7920 e361 6e80 9470 ecef 76e5 2079 ef75 2061 f420 79ef 75f2 206d e573 73e9 e573 f42c 942f 942f

00:00:06;23 94ae 94ae 9420 9420 9470 e361 ec6d 2079 ef75 2061 f420 79ef 75f2 206d efef 64e9 e573 f42c 942f 942f

00:00:08;16 94ae 94ae 9420 9420 94d0 616e 6420 ec61 7567 6820 f7e9 f468 2079 ef75 2061 f420 79ef 75f2 9470 f175 e9f2 6be9 e573 f42c 942f 942f

00:00:10;29 94ae 94ae 9420 9420 94d0 79ef 75a7 76e5 2070 f2ef 6261 62ec 7920 e6ef 756e 6420 79ef 75f2 9470 70e5 f273 ef6e ae80 942f 942f

00:00:13;10 94ae 94ae 9420 9420 9470 4f6e 20f4 ef64 6179 a773 20e3 6173 e52c 942f 942f

00:00:14;10 94ae 94ae 9420 9420 9470 cdf2 ae80 942f 942f

00:00:14;21 94ae 94ae 9420 9420 94d0 4368 6170 6d61 6e20 7361 7973 2068 e520 f468 ef75 6768 f420 68e5 20e6 ef75 6e64 9470 f468 e520 31b3 2079 e561 f273 2061 67ef 20f7 68e5 6e20 68e5 206d e5f4 20cd f2ae 942f 942f

00:00:19;03 94ae 94ae 9420 9420 9470 c7ef f264 ef6e ae80 942f 942f

00:00:19;16 94ae 94ae 9420 9420 94d0 c275 f420 6eef f720 62e5 ece9 e576 e573 20f4 6861 f420 6d75 73f4 2068 6176 e580 9470 61ec ec20 62e5 e56e 2061 2064 f2e5 616d ae80 942f 942f

00:00:22;21 94ae 94ae 9420 9420 9470 cdf2 ae80 942f 942f

00:00:23;02 94ae 94ae 9420 9420 94d0 4368 6170 6d61 6e20 7361 7973 206e eff7 20f4 6861 f420 68e5 a773 9470 e6e9 6e61 ecec 7920 61f7 616b e52c 942f 942f

00:00:24;19 94ae 94ae 9420 9420 1370 68e5 20f2 e561 ece9 7ae5 7320 68e5 a773 2062 e5e5 6e20 73f4 f275 6e67 94d0 61ec ef6e 6720 e6ef f220 79e5 61f2 7320 616e 6420 e973 2064 e56d 616e 64e9 6e67 9470 cdf2 ae80 942f 942f

00:00:29;24 94ae 94ae 9420 9420 9470 43ef f264 2070 f2ef 76e5 2068 e973 20ec ef76 e580 942f 942f

00:00:31;06 94ae 94ae 9420 9420 94d0 6279 2070 f2ef 70ef 73e9 6e67 206d 61f2 f2e9 6167 e520 f4ef 2068 e96d 9470 f4ef 6461 7980 942f 942f

00:00:33;16 94ae 94ae 9420 9420 94d0 eff2 2070 f2e5 7061 f2e5 20e6 eff2 20f4 68e5 20f2 e5ec 61f4 e9ef 6e73 68e9 7080 9470 f4ef 2062 e520 ef76 e5f2 ae80 942f 942f

00:00:36;19 94ae 94ae 9420 9420 9470 4ce5 f4a7 7320 68e5 61f2 20f4 68e5 e9f2 20e3 6173 e5ae 942f 942f

00:00:38;11 942c 942c

00:00:40;24 94ae 94ae 9420 9420 9470 5468 e520 43ef 75f2 f420 e973 206e eff7 20e9 6e20 73e5 7373 e9ef 6eae 942f 942f

00:00:42;12 94ae 94ae 9420 9420 94d0 5468 e520 c8ef 6eef f261 62ec e520 4a75 6467 e520 d3f4 61f2 9470 70f2 e573 e964 e96e 67ae 942f 942f

00:00:45;03 942c 942c

00:00:49;21 94ae 94ae 9420 9420 9470 d9ef 75f2 20c8 ef6e eff2 2c80 942f 942f

00:00:50;06 94ae 94ae 9420 9420 94d0 f468 e973 20e9 7320 f468 e520 e361 73e5 20ef e620 4368 6170 6d61 6e80 9470 76e5 f273 7573 20c7 eff2 64ef 6eae 942f 942f

00:00:51;29 94ae 94ae 9420 9420 9470 5468 616e 6b20 79ef 7520 76e5 f279 206d 75e3 682c 942f 942f

00:00:53;08 94ae 94ae 9420 9420 9470 cdf2 ae80 942f 942f

00:00:53;15 94ae 94ae 9420 9420 9470 4368 6170 6d61 6eae 942f 942f

00:00:53;29 94ae 94ae 9420 9420 9470 cdf2 ae80 942f 942f

00:00:54;08 94ae 94ae 9420 9420 9470 c7ef f264 ef6e ae80 942f 942f

With Non Drop Frame :
#######################################
writer = make_scc_writer(args.fps, drop_frame=False)
scc_text = converter.write(writer)

##################################################

Scenarist_SCC V1.0

00:00:00:17 94ae 94ae 9420 9420 94d0 5768 e56e 20e9 f420 e3ef 6de5 7320 f4ef 20e6 e96e 64e9 6e67 20f4 68e5 9470 ef6e e52c 942f 942f

00:00:02:11 94ae 94ae 9420 9420 94d0 4920 61ec f761 7973 2073 6179 20f4 6861 f420 e9e6 20f4 68e5 7920 e361 6e80 9470 ecef 76e5 2079 ef75 2061 f420 79ef 75f2 206d e573 73e9 e573 f42c 942f 942f

00:00:06:22 94ae 94ae 9420 9420 9470 e361 ec6d 2079 ef75 2061 f420 79ef 75f2 206d efef 64e9 e573 f42c 942f 942f

00:00:08:15 94ae 94ae 9420 9420 94d0 616e 6420 ec61 7567 6820 f7e9 f468 2079 ef75 2061 f420 79ef 75f2 9470 f175 e9f2 6be9 e573 f42c 942f 942f

00:00:10:28 94ae 94ae 9420 9420 94d0 79ef 75a7 76e5 2070 f2ef 6261 62ec 7920 e6ef 756e 6420 79ef 75f2 9470 70e5 f273 ef6e ae80 942f 942f

00:00:13:09 94ae 94ae 9420 9420 9470 4f6e 20f4 ef64 6179 a773 20e3 6173 e52c 942f 942f

00:00:14:09 94ae 94ae 9420 9420 9470 cdf2 ae80 942f 942f

00:00:14:20 94ae 94ae 9420 9420 94d0 4368 6170 6d61 6e20 7361 7973 2068 e520 f468 ef75 6768 f420 68e5 20e6 ef75 6e64 9470 f468 e520 31b3 2079 e561 f273 2061 67ef 20f7 68e5 6e20 68e5 206d e5f4 20cd f2ae 942f 942f

00:00:19:02 94ae 94ae 9420 9420 9470 c7ef f264 ef6e ae80 942f 942f

00:00:19:15 94ae 94ae 9420 9420 94d0 c275 f420 6eef f720 62e5 ece9 e576 e573 20f4 6861 f420 6d75 73f4 2068 6176 e580 9470 61ec ec20 62e5 e56e 2061 2064 f2e5 616d ae80 942f 942f

00:00:22:21 94ae 94ae 9420 9420 9470 cdf2 ae80 942f 942f

00:00:23:02 94ae 94ae 9420 9420 94d0 4368 6170 6d61 6e20 7361 7973 206e eff7 20f4 6861 f420 68e5 a773 9470 e6e9 6e61 ecec 7920 61f7 616b e52c 942f 942f

00:00:24:19 94ae 94ae 9420 9420 1370 68e5 20f2 e561 ece9 7ae5 7320 68e5 a773 2062 e5e5 6e20 73f4 f275 6e67 94d0 61ec ef6e 6720 e6ef f220 79e5 61f2 7320 616e 6420 e973 2064 e56d 616e 64e9 6e67 9470 cdf2 ae80 942f 942f

00:00:29:24 94ae 94ae 9420 9420 9470 43ef f264 2070 f2ef 76e5 2068 e973 20ec ef76 e580 942f 942f

00:00:31:06 94ae 94ae 9420 9420 94d0 6279 2070 f2ef 70ef 73e9 6e67 206d 61f2 f2e9 6167 e520 f4ef 2068 e96d 9470 f4ef 6461 7980 942f 942f

00:00:33:15 94ae 94ae 9420 9420 94d0 eff2 2070 f2e5 7061 f2e5 20e6 eff2 20f4 68e5 20f2 e5ec 61f4 e9ef 6e73 68e9 7080 9470 f4ef 2062 e520 ef76 e5f2 ae80 942f 942f

00:00:36:19 94ae 94ae 9420 9420 9470 4ce5 f4a7 7320 68e5 61f2 20f4 68e5 e9f2 20e3 6173 e5ae 942f 942f

00:00:38:10 942c 942c

00:00:40:23 94ae 94ae 9420 9420 9470 5468 e520 43ef 75f2 f420 e973 206e eff7 20e9 6e20 73e5 7373 e9ef 6eae 942f 942f

00:00:42:12 94ae 94ae 9420 9420 94d0 5468 e520 c8ef 6eef f261 62ec e520 4a75 6467 e520 d3f4 61f2 9470 70f2 e573 e964 e96e 67ae 942f 942f

00:00:45:02 942c 942c

00:00:49:20 94ae 94ae 9420 9420 9470 d9ef 75f2 20c8 ef6e eff2 2c80 942f 942f

00:00:50:05 94ae 94ae 9420 9420 94d0 f468 e973 20e9 7320 f468 e520 e361 73e5 20ef e620 4368 6170 6d61 6e80 9470 76e5 f273 7573 20c7 eff2 64ef 6eae 942f 942f

00:00:51:28 94ae 94ae 9420 9420 9470 5468 616e 6b20 79ef 7520 76e5 f279 206d 75e3 682c 942f 942f

00:00:53:07 94ae 94ae 9420 9420 9470 cdf2 ae80 942f 942f

00:00:53:15 94ae 94ae 9420 9420 9470 4368 6170 6d61 6eae 942f 942f

00:00:53:29 94ae 94ae 9420 9420 9470 cdf2 ae80 942f 942f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants