Schroedinger-Hat / youtube-to-anchorfm

An automation process to convert YouTube video into audio file and uploading it to Anchor.fm podcast
MIT License
127 stars 70 forks source link

Specifying the time from youtube video to upload to Anchor? #12

Closed JosueAChavez closed 2 years ago

JosueAChavez commented 2 years ago

First off, thanks for creating this amazing tool. This is something I exactly need for uploading live streams to Anchor.

Is it possible to modify the episode.json file to include the start and stop times of the youtube video you want to be uploaded to Anchor? If there isn't maybe inside episode.json have a field for the start and end times of the video in seconds:


  "id": "nHCXZC2InAA",
  "start_time": "256",
  "end_time": "3000"
}
Wabri commented 2 years ago

Good idea, we will think about it.

TheJoin95 commented 2 years ago

Actually we are using youtube-dl lib and it's not providing any methods to split the input video. We should do this on our side: cropping the video-audio of the webm file and save it again.

We can evalutate to use ffmpeg in order to accomplish this, but it would be a very heavy load on the Github Action especially counting the free execution time per month available.

I believe the video input should be alread cutted and ready to be uploaded on anchorfm. Eventually, the audio can be edited on anchorfm after the upload.

JosueAChavez commented 2 years ago

Ah yes that's very true. I had not considered the processing load that ffmpeg can bring. Having Anchor.fm edit the audio as segments may be a solution, but I can imagine it would be difficult to get the trim right because it's a lot steps.

weltonrodrigo commented 2 years ago

We can evalutate to use ffmpeg in order to accomplish this, but it would be a very heavy load on the Github Action especially counting the free execution time per month available.

I submited #22 which can accomplish

{ 
  "id": "nHCXZC2InAA",
  "start_time": "256",
  "end_time": "3000"
}

with

env:
  PREPROCESSOR_ARGS: "ffmpeg:'-ss 256 -to 3000'"

In case that PR cannot be merged, my branch can be specified on the action:

jobs:
  upload_episode:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Upload Episode from YouTube To Anchor.Fm
        uses: weltonrodrigo/youtube-to-anchorfm@new-anchor
TheJoin95 commented 2 years ago

I've merged the PR, it was a really nice one. Good job and thanks on helping this project out :)