Unofficial Hacker News companion — get notified on comment replies, and more.

Best way to process a YouTube video/playlist on your website?

8 points by vivzkestrel 2 days ago 12 comments (opens Hacker News) Vote (opens Hacker News)

View full thread · View on Hacker News

Comment thread (4)

  1. - well my app is more complicated

    - i need video frames to ocr

    - maybe i can process video to frames and send frames over to server directly or aws s3 bucket directly with video id as folder

    - not sure if there are better ways

    Replies (1)
    1. Sounds interesting. downloading the video is the hassle. better send the video url to the server and do all heavy things there. What is your ocr workflow? I have a use case that i had built previously but it wasn't very accurate. I tried to build a pullup counter which would classify bad form also but then that was beyond just a hassle and i gave it up, but now i feel with these system one workflows maybe these problem shapes can be approached but i haven't tried them.
      Replies (1)
      1. - if i send the url to the server, my backend would need to download it inside a worker.

        - this worker would have to use yt-dlp unless youtube api provides a way to download videos not belonging to your channel

        - the worker's IP address ll definitely get flagged by youtube after a few short runs

        - not to mention i have no idea what is the legality of doing this as a limited liability company

        - the workflow for ocr is simple, once i have the frames from input video, i can add a task to the queue with s3 image links per video id and any model such as paddle ocr, chandra etc can quickly perform the image analysis and send my express server back the results

        - the major bottleneck for me seems to be the process to get an mp4 out of youtube currently

        Replies (1)
        1. i dont think youtube will let you download the mp4 cause why would they. I am thinking about the download option youtube provides. When you download a video its in your system now right so it must be somewhere. IndexDB perhaps idk but if that can be salvaged you could lean into youtube's own feature for your requirement but then i dont think every video is downloadable. This will also allow you to keep your download and frame processing workload in the client side and only stream frames.