From bb4001208523de44f30a35c08927cfd87313a058 Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Mon, 26 Feb 2024 15:22:55 +0200 Subject: [PATCH] content/video-editing: iterate solutions, etc --- content/video-editing.rst | 97 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 90 insertions(+), 7 deletions(-) diff --git a/content/video-editing.rst b/content/video-editing.rst index 5d17492..8bb85f2 100644 --- a/content/video-editing.rst +++ b/content/video-editing.rst @@ -90,6 +90,18 @@ These exercises will take you through the whole sequence. Whisper is left as an exercise to the reader. + .. solution:: + + Example Whisper command: + + .. code-block:: + + whisper --device cuda --output_format srt --initial_prompt="Welcome to CodeRefinery day four." --lang en --condition_on_previous_text False INPUT.mkv + + An initial prompt like this make Whisper more likely to output + full sentences, instead of a stream of words with no + punctuation. + .. exercise:: Editing-3: Create the basic editlist.yaml file @@ -98,9 +110,10 @@ These exercises will take you through the whole sequence. follow its instructions, to create an edit with these features: * Input/output definitions - * Two two sections: the "Intro to the course", and "From data + * Two output sections: the "Intro to the course", and "From data storage to your science" talks (Remember it said the recording - started at 11:35... look at the schedule!) + started at 11:35... look at the schedule for hints on when it + might start!) A basic example: @@ -119,7 +132,8 @@ These exercises will take you through the whole sequence. .. solution:: - This is an excerpt from our actual editlist file of this course + This is an excerpt from our `actual editlist file of this course + `__ .. code-block:: yaml @@ -192,9 +206,10 @@ These exercises will take you through the whole sequence. $ ffmpeg-editlist editlist.yaml . Just running like this is quick and works, but the stream may be - cut at a bad point and thus the first few seconds of each - segment may be garbled. For a final processing, add the - ``--reencode`` option, which re-encodes the video. + garbled in the first few seconds (because it's missing a key + frame). (A future exercise will go over fixing this. + Basically, add the ``--reencode`` option, which re-encodes the + video (this is **slow**). Look at the ``.info.txt`` files that come out. @@ -215,13 +230,78 @@ These exercises will take you through the whole sequence. - 15:00: Part 2 # <-- New - end: 20:00 - Look at the ``.info.txt`` files that come out now. + Look at the ``.info.txt`` files that come out now. What is new? * Add in "workshop title", "workshop description", and see the ``.info.txt`` files that come out now. This is ready for copy-pasting into a YouTube description (first line is the title, rest is the description). + Look at the new ``.info.txt`` files. What is new? + + .. solution:: + + * `Example of the workshop description for this course + `__ + * This course actually didn't have chapters for the first day + sessions, but you can `see chapters for day 2 here + `__, + for example. + * Example info.txt file for the general introduction to the + course. The part after the ``-----`` is the workshop description. + + .. code-block:: + + 1.2 Introduction - HPC/SciComp Kickstart summer 2023 + + General introduction to the workshop. + + https://scicomp.aalto.fi/training/kickstart/intro/ + + ----- + + This is part of the Aalto Scientific Computing "Getting + started with Scientific Computing and HPC Kickstart" 2023 + workshop. The videos are available to everyone, but may be + most useful to the people who attended the workshop and want + to review later. + + Playlist: + https://www.youtube.com/playlist?list=PLZLVmS9rf3nMKR2jMglaN4su3ojWtWMVw + + Workshop webpage: + https://scicomp.aalto.fi/training/scip/kickstart-2023/ + + Aalto Scientific Computing: https://scicomp.aalto.fi/ + + + +.. exercise:: Editing-6: Subtitles + + Re-run ffmpeg-editlist with the ``--srt`` option (you have to + install it with ``pip install ffmpeg-editlist[srt]`` to pull in the + necessary dependency). Notice how ``.srt`` files come out now. + + Use some subtitle editor to edit the *original* subtitle file, to + fix up any transcription mistakes you may find. You could edit + directly, use ``subtitle-editor`` on Linux, or find some other + tool. + + What do you learn from editing the subtitles? + + .. solution:: + + ..code-block:: + + $ ffmpeg-editlist --srt editlist.yaml + + There should now be a ``.srt`` file also generated. It + generated by finding the ``.srt`` of the original video, and + cutting it the same way it cuts the video. Look and you see it + aligns with the original. + + This means that someone could have been working on fixing the + Whisper subtitles while someone else was doing the yaml-editing. .. exercise:: Editing-6: Subtitles @@ -236,6 +316,9 @@ These exercises will take you through the whole sequence. What do you learn from editing the subtitles? + + + .. admonition:: Discussion: how to distribute this? :class: discussion