Code with me | FFMPEG compressing video | python

preview_player
Показать описание
Coding a much needed task to help save storage space in my NAS. ffmpeg compression video.

○○○ LINKS ○○○

○○○ SHOP ○○○

○○○ SUPPORT ○○○

○○○ SOCIAL ○○○

○○○ Send Me Stuff ○○○
Don Hui
PO BOX 765
Farmingville, NY 11738

○○○ Music ○○○
From Epidemic Sounds

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission.
Рекомендации по теме
Комментарии
Автор

I used to do this all the time back in the day! the only difference is I prefer to use shell script for this kind of thing since you only need 2 lines max.

1) Set a variable to store the results of the find command:
files=$( find /media/share/YouTube/media/ -type f \( -iname \*.mov -o -iname \*.mp4 \) )

2 ) iterate over the results (with the "i" variable) and use it as input:
for i in "$files"; do ffmpeg -i "$i" -c:v libx264 -crf=22 -c:a copy "$(dirname "$i")/compressed-"$(basename "$i")""; done

Thanks for the video!

carloschon
Автор

thanks for watching!! i'll upload the code soon to github and post it here

NovaspiritTech
Автор

First of all thanks for showing how to do ffmpeg encoding using Python. I viewed a few hours after upload. I found it a struggle to watch as for much of the time nothing much happens. Probably better live. I would have preferred you to do a more ‘how to video’ but I understand the computer problems you are having. Keep up the good work.

minutessecondsorless
Автор

Not using python but the line 'for subdirs, dirs, files in os.walk(dir)' is interesting.

LiRaye
Автор

You should probably us 'in' to check right extension, as you want to catch many extensions.

You also might want to use functions to filter out the wanted extensions instead. Then you don't need to code loops and stuff.
Functional for the win, as you kids say. 😜

AndersJackson
Автор

Is it possible to compress videos using Python without installing the ffmpeg tool directly.

ThilagaVathi-fj
Автор

Why the cfr 22? That's an odd frame rate out of sync with ... everything? Just curious to know :D
Nice to see I'm not the only one getting a lot of errors in "simple" coding projects. But that only makes it so much more satisfying when you succeed - and you have learned something useful along the way.

publicmichaelzmit
Автор

You have forgot to create the dir in case of mp4 and forrgot that at some point it will find the compressed video and recomoress and just tyke up more and more space.

honzapat
Автор

The compressed folder is created but it is empty...Is there any minimum size for the video??

sailajasrinivasan
Автор

I need this!!! Tried handbrake but compression was lossy

cmloke
Автор

Openbox interesting, just going through your videos.

celestialbeing
Автор

hi, how to make image compression using wavelet transform in python ? ı can not find in nowhere . please can you help me ?

sametocsy
Автор

Thanks for the code but I have facing the problrm regarding 'ffmpeg' is not recognized as an internal or external command after installing it in my pycharm project.

urvishsoni
Автор

You should use Emacs and probably start with my setup. 😜

And continue use Linux for streamimg. 😜

There are a Open source version of studio that doesn't call home like MS version do, IF you want to use studio.

AndersJackson
Автор

You should start python videos for beginners

iabakar
Автор

Lower microphone gain and put it closer to your mouth. Gain is way too high and the mic is way too far away from the mouth. Which equals horrid background noise + smashing of keyboard buttons of which I cannot stand hearing xd

Robber
Автор

I tried exactly the same code and python gave me 'name "file" is not defined', SOS:)

hfhenry
Автор

Where is the code?? I mean seriously! If you are doing some tutorial, its generally one's duty to include a code in description or pinned comment.

imhemish