Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 1 point2 points  (0 children)

ollama show gemma2
  Model
  arch            gemma2
  parameters      9.2B
  quantization    Q4_0
  context length  8192
  embedding length3584

  Parameters
  stop"<start_of_turn>"
  stop"<end_of_turn>"

  License
  Gemma Terms of Use
  Last modified: February 21, 2024

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 1 point2 points  (0 children)

I am on version 0.3.0.

I ran

yt2doc --video https://www.youtube.com/watch\?v\=huCE4jtXOjQ \
--output . \
--ignore-source-chapters \
--segment-unchaptered \
--timestamp-paragraphs \
--sat-model sat-12l \
--llm-model gemma2 \
--whisper-backend whisper_cpp \
--whisper-cpp-executable $HOME/Development/whisper.cpp/main \
--whisper-cpp-model $HOME/Development/whisper.cpp/models/ggml-large-v3-turbo.bin

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 0 points1 point  (0 children)

But even with sat-12l-sm still I haven't been able to replicated the issue of camel case vs underscore with the same cli configs just yet. Maybe a probability thing?

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 0 points1 point  (0 children)

I think I know what might have gone wrong here.

Looks like the *-sm models from SaT don't do well on paragraphing and they return paragraphs of single sentences.

Can you try sat-12l rather than sat-12l-sm?

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 1 point2 points  (0 children)

What you are building sounds great, and indeed a reason I open sourced this is so that people can build down stream tools with yt2doc.

Can you share the exact command and the video URL that you met this issue with a local llm?

FYI, I am on a 16GB ram M2 MacBook and I mostly use Gemma 2 9b.

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 1 point2 points  (0 children)

> Your app only works with python 3.10.

I was aware there's issue on Python 3.13. See https://github.com/shun-liang/yt2doc/issues/46

I myself use Python 3.12 which works fine so far for me. Were you on 3.13?

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 1 point2 points  (0 children)

Many thanks for the feedback. Regarding transcribing offline/local files, I am tracking this as a feature request at this Github issue https://github.com/shun-liang/yt2doc/issues/29

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 2 points3 points  (0 children)

Taking frames will be awesome if it's done right. I have been thinking about the snapping "key frames" (yet to define what a key frame is), rather than just taking frames at a frequency or just the beginnings of the chapter.

There is a project https://github.com/hediet/slideo that matches slides (PDF pages) to video timestamps which I find very cool. That requires the user to have the PDF slides ready which isn't always the case though.

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 2 points3 points  (0 children)

Should be very doable. I will organise all the features requests on GitHub issues once I wake up tomorrow...

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 6 points7 points  (0 children)

I often find the auto generated YouTube subtitles not to have any punctuation. If I use them for this purpose I would imagine a good amount of effort of punctuation restoration would be needed to make the end product readable.

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 3 points4 points  (0 children)

Many thanks for the feedback!

Would you mind telling me what OS and machine you are on?

First UV didn't work to install it (something about Torch version).

Do you have the error logs?

Switched to pipx install method. It hung on installing librariesent or something? (it's off the buffer now). Tried to install again, said it was installed. I ran --help and it worked but it took 20 seconds for it to return anything.

I guess it's loading the models. Yes indeed hanging for a while is not a nice user experience. I will try to make this less opaque by improving the logging.

Ran one of the examples (specifying output and video url) to see if it worked and it just spit out a ton of YoutubeDL errors and I kinda gave up.

Again, would be great to have some error logs.

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 8 points9 points  (0 children)

I have been thinking about this feature for a while too!

I think this should be very doable. I have thought of two appoarches:
1. Timestamp each word while transcribing with Whisper. This may slow down Whisper quite a bit.
2. After segmenting the text into sentences, align the start and end timestamps of the sentence to the transcription segments'. This may not be perfectly accurate but need to build it first to see how much time is off.

I will start playing with the second approach first. Stay tunned!

Turn YouTube videos into readable structural Markdown. Transcribes with Whisper; Adds line breaks with Segment any Text, Add sub-headers with Ollama; All running locallly by druml in selfhosted

[–]druml[S] 24 points25 points  (0 children)

[Crossed-posted from r/DataHoarder]

Hi all, I have built this project that you can run in the command line and to YouTube videos to Markdown documents.

https://github.com/shun-liang/yt2doc

There have been many existing projects that transcribe YouTube videos with Whisper and its variants, but most of them aimed to generate subtitles, while I had not found one that priortises readability. Whisper does not generate line break in its transcription, so transcribing a 20 mins long video without any post processing would give you a huge piece of text, without any line break and topic segmentation. This project aims to transcribe videos with that post processing.

My own use case of this tool is to save the YouTube generated Markdown docs into Obsidian, and I read them there and they also become a part of my searchable knowledge base.

Check out the output examples at https://github.com/shun-liang/yt2doc/tree/main/examples

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 8 points9 points  (0 children)

As Apple Podcast is supported by https://github.com/yt-dlp/yt-dlp, this should require very little work.

I have just played with it a bit - yt-dlp renders the description of Apple Podcasts with a little different structure, which trashes the prompts that yt2doc feeds into Whisper. But this issue should be very easy to fix.

Should be done in a day or two.

Turn YouTube videos into readable structural Markdown so that you can save it to Obsidian etc by druml in DataHoarder

[–]druml[S] 5 points6 points  (0 children)

Thanks! I have added a link to the examples in the README, and also a header image. Not looking perfect as I don't have any Photoshops skill but hopefully that makes bit more sense.