How to Trim Videos Using Python and FFMPEG

Поділитися
Вставка
  • Опубліковано 26 сер 2024

КОМЕНТАРІ • 31

  • @nash-p
    @nash-p Рік тому +3

    Thank you so so much, I've been trying for over two hours to figure out the syntax for trim. Not only do I know how to use trim, but I found a better way to cut audio with the filter method 👍

    • @CodingWithAdam
      @CodingWithAdam  Рік тому +1

      You’re welcome! I’m really glad the tutorial helped. Happy to hear you also found a better way to cut audio 😁

  • @mangoship
    @mangoship Рік тому +2

    This was very helpful, thanks!

  • @CarlosHenrique-er7zq
    @CarlosHenrique-er7zq 2 роки тому +3

    Thank you for the help, it was excatly what I needed.

  • @JohnCarrFitness
    @JohnCarrFitness 2 роки тому +3

    Excellent teaching! Keep it up! You’ve got a skill most programmers don’t!

  • @yao_barna
    @yao_barna 2 роки тому +3

    Great tutorial, thanks! Very useful.

  • @birukgetnet1
    @birukgetnet1 Рік тому +2

    Thank you sir. It helped me alot.

  • @HoorayforOranges
    @HoorayforOranges Рік тому +1

    Hi, on line 10 of app.py why do you check for the format before checking for the duration, why not just call get on the duration key instead?

    • @CodingWithAdam
      @CodingWithAdam  Рік тому +1

      The format is a key on the in_file_probe_result the format then has a key on it called duration. Hope that helps!

  • @hanaalalawi4321
    @hanaalalawi4321 2 роки тому +2

    Thanks for this tutorial! Is it possible to trim based on a condition, for example, I want to trim based on a sentence

    • @CodingWithAdam
      @CodingWithAdam  Рік тому +2

      That's an interesting question. There is nothing I know that is built into FFMPEG that would do that. For this to be possible the video would have to transcribed and time coded to the transcription. It's a very interesting topic and if you figure it out please let me know.

    • @hanaalalawi4321
      @hanaalalawi4321 Рік тому +1

      @@CodingWithAdam Sure, I'm still working on it.

  • @AndreGomes-em5vy
    @AndreGomes-em5vy 3 місяці тому

    How to use this in Google Colab? How to ensure the installation of FFMPEG?

  • @mylesgxtreme2106
    @mylesgxtreme2106 2 роки тому +1

    can you set it to cut multiple times in on video like take out 5 seccend every 30 second or so

    • @CodingWithAdam
      @CodingWithAdam  2 роки тому +1

      I have not tried it but It seems like you should be able to. You would then join all the parts together to form a complete video.

    • @yao_barna
      @yao_barna 2 роки тому +1

      I just landed on this tutorial and haven't tried this much but once you have a function that works for a (startTime, endTime) interval, you could make use of this function to run it in the range you desire. It's just an idea of how to begin with.

  • @alkispiskas3580
    @alkispiskas3580 Рік тому

    Why do you use `probe_result.get("format").get("duration")` when you can use simply `probe_result["format"]["duration"]` ?

    • @CodingWithAdam
      @CodingWithAdam  Рік тому +1

      When you use get you can specify a default value if it is not found. I believe I specified a empty object as the default. You are 100% right that you can simply use the array key value. Both are valid approaches 😀

  • @adityachauhan4325
    @adityachauhan4325 Рік тому

    Hi, could you tell me why the video resolution is reduced by the code?

  • @JohnCarrFitness
    @JohnCarrFitness 2 роки тому +1

    Could you put that code on github to share?

    • @CodingWithAdam
      @CodingWithAdam  2 роки тому +2

      Thanks for noticing the code was not linked. I updated the description and here is the link github.com/CodingWith-Adam/trim-videos-with-ffmpeg-python

    • @JohnCarrFitness
      @JohnCarrFitness 2 роки тому +2

      @@CodingWithAdam Thanks Adam! You da man! Can i ask.. how long have you been programming? I'm newer here.. thanks

    • @CodingWithAdam
      @CodingWithAdam  2 роки тому +2

      You’re welcome! I’ve been programming for a long time almost 19 years. It’s a fun career with lots of learning. I started this channel as a hobby project to help mentor through interesting projects. Congratulations on learning to code it can be a lot of fun!

    • @JohnCarrFitness
      @JohnCarrFitness 2 роки тому +2

      @@CodingWithAdam So awesome Adam! I can tell you know this stuff much deeper than most youtubers. Please keep your channel up! Youre a great teacher!

    • @CodingWithAdam
      @CodingWithAdam  2 роки тому +1

      Thank you John! I really appreciate the kind words. I’ll do my best :)