Skip to content

Commit

Permalink
content/video-editing: iterate solutions, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
rkdarst committed Feb 26, 2024
1 parent f17efa0 commit bb40012
Showing 1 changed file with 90 additions and 7 deletions.
97 changes: 90 additions & 7 deletions content/video-editing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:

Expand All @@ -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
<https://github.com/AaltoSciComp/video-editlists-asc/blob/master/kickstart-2023.yaml#L16-L53>`__

.. code-block:: yaml
Expand Down Expand Up @@ -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.

Expand All @@ -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
<https://github.com/AaltoSciComp/video-editlists-asc/blob/master/kickstart-2023.yaml#L1-L13>`__
* This course actually didn't have chapters for the first day
sessions, but you can `see chapters for day 2 here
<https://github.com/AaltoSciComp/video-editlists-asc/blob/master/kickstart-2023.yaml#L239-L262>`__,
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

Expand All @@ -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

Expand Down

0 comments on commit bb40012

Please sign in to comment.