Comments (8)
Bit of a lapse in brainulating today. Because VodBot deals in MP4's, and uses -c copy
with ffmpeg, its purely a CPU operation simply copies data from one file to another. Closing.
from vodbot.
After thinking it over for a while, I've discovered that the above comment can be incorrect in cases where videos from multiple different source files can lead to mixing formats and bitrates, which in turn leads to potentially catastrophic video errors.
It's very much worth looking into potential external hardware encoders, although configuration of these encoders in the ffmpeg commands can be tricky.
Note to self: search any and all direct drop-in strings for potential security issues.
from vodbot.
Some useful encoding params...
ffmpeg -i input.avi -c:v libx264 output.mp4 # Software H.264
ffmpeg -i input.avi -c:v libx265 output.mp4 # Software HEVC/H.265
-
ffmpeg -i input.avi -c:v h264_amf output.mp4 # AMD Accel. H.264
ffmpeg -i input.avi -c:v hevc_amf output.mp4 # AMD Accel. HEVC/H.265
-
ffmpeg -i input.avi -c:v h264_qsv output.mp4 # Intel Accel. H.264
ffmpeg -i input.avi -c:v hevc_qsv output.mp4 # Intel Accel. HEVC/H.265
ffmpeg -i input.avi -c:v av1_qsv output.mp4 # Intel Accel. HEVC/H.265
-
ffmpeg -i input.avi -c:v h264_nvenc output.mp4 # Nvidia Accel. H.264
ffmpeg -i input.avi -c:v hevc_nvenc output.mp4 # Nvidia Accel. HEVC/H.265
This is specifically for the output, video decoders must be specified with -c:v decoder_here
before the -i input.avi
arguments.
from vodbot.
https://trac.ffmpeg.org/wiki/HWAccelIntro
Seems like hardware acceleration on Linux for AMD is meant to use VAAPI, as it at least has partial support. Instead of custom parameters from config it may be safer to simply provide a config variable with "nvidia-264", "amd-265", "intel-av1", etc. as options.
from vodbot.
So for determining decode type for using hw acceleration, ffmpeg has a side program called ffprobe that can find useful info from a file. So ffprobe -v quiet -select_streams v:0 -show_entries stream=codec_name -of default=noprint_wrappers=1:nokey= 1 /mnt/archive/vods/notquiteapex/2022-12-10T23\;01\;47Z_1675749547.mkv
will return "h264", which python will need to grab to determine how to decode the file. Most if not all twitch streams will be h264.
from vodbot.
SO! VAAPI is exclusive to Linux, and in my testing it is not at all necessary for using AMD hardware acceleration on Linux, and that the FFmpeg wiki is simply out of date.
I'm thinking of two config options to add, first is hwaccel_encoder
(options are "software", "amd", "intel", and "nvidia"), next is hwaccel_decoder
(same as before), and hwaccel_format
(options are "h264", "hevc", and "av1"). The first two options handle how the video is managed, the last option handles how the videos are saved to the system and how they should be expected to be handled when local. There would probably be ffprobe checks in place to make sure that the expected and actual formats, though.
from vodbot.
Internally, there would simply be a multidimensional dictionary that handles translating the codec and format options to their respective ffmpeg options (like "av1" and "intel" translating to "av1_qsv"). This would not be a simple string manipulation, due to the weird/different names that ffmpeg uses for codecs and formats (h265 is hevc but not by name, intel is qsv, etc).
MKV's will still be used because its a great container format.
from vodbot.
Lastly, subprocess.run
can redirect stdout to a useful output that isn't the stdout of VodBot. it would simply be using subprocess's pipe object to get the bytes data out of the programs stdout. See here https://csatlas.com/python-subprocess-run-stdout-stderr/
from vodbot.
Related Issues (20)
- Chat parsing fails when chat is empty
- Description may not be accepted by youtube for containing specific characters.
- Printing Vod class throws an exception for missing attribute duration, should be length
- Chat export to YouTube does not properly format entity codes.
- Properly store OAuth information outside of pickling HOT 1
- Crash on mkdir when permission is denied.
- Failing to form videos with copyright-related muted segments HOT 6
- Crash on moving files across drives on Windows
- cache file in temp directory HOT 2
- change raw chatlogs to use JSON instead of custom format
- Google has removed out-of-band authentication
- Allowing any user to upload (distributing API credentials) HOT 1
- Attempt to download unmuted segments where possible.
- Separate VODs into finer categories
- Urgent - Integrity Check Failed regarding certain GQL data HOT 2
- Unexpected exception when processing a channel that does not exist
- Error on upload causes a crash instead of being reported and handled safely HOT 1
- VodBot writing files with URL query params
- Twitch disallowing access to public VODs
- Forbidden VOD playlist URL
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vodbot.