Ранее я уже упоминал о другой фишке из ˍˍfutureˍˍ , это оператор деления.
from __future__ import division
Суть проста. Раньше сложность типа данных результата поределялась типом самого сложного операнда.
Например:
int/int => int
int/float => float
В первом случае оба операнда int, значит и результат будет int. Во втором float более сложный тип, поэтому результат будет float.
Если нам требуется получить дробное значение при делении двух int то приходилось форсированно один из операндов конверировать в float.
12/float(5) => float
Но с новой "философией" это не требуется. В Python3 "floor division" заменили на "true division" а старый способ теперь работает через оператор "//".
>>> 3/2
1.5
>>> 3//2
1
То есть теперь деление int на int даёт float если результат не целое число.
В классах теперь доступны методы __floordiv__() и __truediv__() для определения поведения с этими операторами.
Данный переход описан в PEP238.
#pep#2to3#basic
📰 FFmpeg Introduces Vulkan-Accelerated 360 Degree Video Conversion
Beyond the capabilities of just the Vulkan Video API, the FFmpeg multimedia library has made interesting Vulkan-accelerated adaptations using compute shaders. With Vulkan compute they've implemented Apple ProRes video acceleration, FFV1 decode, and other features. The newest Vulkan feature now in place for FFmpeg is 360 degree video conversion...
🔗 Source: https://www.phoronix.com/news/FFmpeg-360-Degree-Vulkan
#ffmpeg
📰 FFmpeg 8.1 Released With Experimental xHE-AAC MPS212, More Vulkan Acceleration
FFmpeg 8.1 is out today as the newest stable release of this widely-used, open-source multimedia library...
🔗 Source: https://www.phoronix.com/news/FFmpeg-8.1-Released
#opensource#ffmpeg
📰 Gentoo-Based Redcore Linux Hardened 2601 Released with Kernel 6.19
Redcore Linux Hardened 2601 Vulpecula has been released, featuring Linux kernel 6.19, FFmpeg 8, and updates to the Sisyphus package manager.
🔗 Source: https://linuxiac.com/gentoo-based-redcore-linux-hardened-2601-released-with-kernel-6-19/
#ffmpeg#kernel#linux
Кстати! Я всем советую попробовать HandBrake — программу для ужатия видео.
Это графический интерфейс для мощной библиотеки ffmpeg, которая заточена на перегонку видео в разные форматы.
Я в основном использую для уменьшения размера файлов, чтобы телеграм проигрывал их без звука автоматически
Тут подробнее писал как это работает
Анимацию постом выше я просто закинул и без изменения настроек перегнал из mpg в mp4. Размер изменился с 4.5мб до 300кб
А для тизера «Коротких вопросов» нажав две кнопки, смог уменьшить файл со 167 мб до (!) 3 мб. За счет уменьшения размера сторон с 4к до 720p.
На мобиле разницы скорее всего не будет видно, а вовлечение в просмотр повысится — сплошная польза!
Работает на всех платформах, в том числе на маке и линуксе!
🎤Ссылки на утро — второй канал
⏲Ускорить YouTube за звезду (VPN за 2₽)
#ToolReview@cogload#ffmpeg@cogload#telegram@cogload
🔖 The creator of ffmpeg Fabrice Bellard(1) is truly a genius and has created so many amazing software that have been an amazing benefit to the world. | Hacker News #pinboard#pantheon#ffmpeg#person
Yeah definitely. If programming genius had a unit it should be called the bellard.
One 10x programmer = a 1/10th Bellard?
100x 工程师,可以放在万神殿了
https://news.ycombinator.com/item?id=25487711
This is Probably the Best Video Downloader App (And it is Free and Open Source) | itsFOSS
VidBee allows you to download videos from YouTube, Facebook, X, Instagram, etc. In fact, it supports over 1,800 websites.
It is built on top of popular command line tools like yt-dlp and #ffmpeg. For the interface, it uses the Electron framework. I understand that some people dislike Electron framework as it runs a web browser underneath, but the 'advantage' of this framework is that you get the same interface in all the operating systems. At least, it's an advantage for the developers as they don't have to build the interface separately for #Linux, #Windows and #macOS.
The source code for VidBee is available on its GitHub repository.
#VidBee - Free Open Source Video Downloader
https://vidbee.org/