Comments (3)
@cr08 I'll have to thank you before I get to what you've just said. I love getting useful and well structured suggestions like yours from the community.
And to answer each of your points:
-
Yes, I agree that video2x isn't handling streams very well. I'll have to read deeper into how video/audio streams work before I can enhance the experience properly.
-
You can already add FFMPEG arguments manually in
video2x.json
in a few updates ago, but I still want to give the user more control over what's being passed to FFMPEG. You can also define the encoding by just changing the suffix of the output video I believe. As for extra arguments forwaifu2x-caffe
, I'll make it happen. -
That's a good idea, I'll add a cache folder setting in the config file (
video2x.json
).
from video2x.
I think I've figured out the stream bit after toying around with ffmpeg and finding some obscure superuser.com posts. This is essentially what I have come up with:
ffmpeg -i ORIG_VIDEO.mkv -i upscaled\no_audio.mp4 -map 1:v:0 -map 0 -c copy -map -0:v FINAL_MUX.mkv
This is assuming the original video is still intact during this process which it should be. We are initially pulling in both the original with all streams as well as the newly upscaled video only stream. -map 1 :v :0 says we want to start right off the top with the newly upscaled video stream from the second input file to take precedence as stream 0 in the final mux. -map 0 has us taking every stream, video, audio, subtitles, and otherwise, from the original video and -c copy obviously has us copying it all over without any re-encoding. -map -0:v (see the extra hyphen at -0, which eluded me for some time as an option) says any video streams in the original video we will ignore and will not make it into the final mux.
As for the ffmpeg arguments bit, I am aware of that. However in its current state it applies to all stages that use ffmpeg equally which may not be desired. ie: The scenario I made above about needing to crop the source video before exporting frames. That crop filter will not apply well on the h264 encode after everything is upscaled for example. I will admit, however, that it may be a limited use case.
Additionally certain options in ffmpeg are sensitive to what order the arguments are in which makes it even more of a pain. Honestly I'm not even sure at this point how to accomplish that in the cleanest way possible.
from video2x.
@cr08 Thanks for the explaination for the map option.
The most ideal way for this project to be written will be to use the python-ffmpeg library instead of the ffmpeg binary. I still really want to look into the library.
The only way I can add customization into every ffmpeg command is to create a separate entry for every ffmpeg command executed, which will be quite some work, and deosn't seem very elegant.
I'm pretty busy recerntly with my school work, I'll take a look at how to improve this script once I'm done with this intense period of time.
from video2x.
Related Issues (20)
- Command '['D:\\Downloads\\аня\\доп\\video2x-4.8.1-win32-full\\dependencies\\ffmpeg\\bin\\ffmpeg', '-hwaccel', 'auto', '-y', '-i', 'D:\\Downloads\\аня\\cz.mp4', '-pix_fmt', 'rgb24', 'C:\\Users\\108na\\AppData\\Local\\Temp\\video2x\\tmp_55ghj8e\\extracted_%0d.png']' returned non-zero exit status 1. HOT 1
- ve
- car
- Get progress from docker container
- Please don't ignore this issue HOT 1
- Command '['C:\\Users\\SWARUP\\Downloads\\video2x-4.8.1-win32-full\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-ncnn-vulkan\\waifu2x-ncnn-vulkan', '-n', '2', '-s', '2', '-t', '400', '-m', 'C:\\Users\\SWARUP\\Downloads\\video2x-4.8.1-win32-full\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-ncnn-vulkan\\models-cunet', '-g', '0', '-j', '10:10:10', '-f', 'png', '-i', 'C:\\Users\\SWARUP\\AppData\\Local\\Temp\\video2x\\tmpqos4p_dy', '-o', 'C:\\Users\\SWARUP\\AppData\\Local\\Temp\\video2x\\tmpfjdj4hfm']' returned non-zero exit status 3221225477.
- I need advice about a runtime failure in Video2x 4.8.1 HOT 1
- video2x cannot be start :(
- Command '['C:\\Users\\Miloud-18\\Desktop\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-ncnn-vulkan\\waifu2x-ncnn-vulkan', '-n', '2', '-s', '2', '-t', '400', '-m', 'C:\\Users\\Miloud-18\\Desktop\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-ncnn-vulkan\\models-cunet', '-g', '0', '-j', '1:1:1', '-f', 'png', '-i', 'C:\\Users\\MILOUD~1\\AppData\\Local\\Temp\\video2x\\tmpaqv4fyo5', '-o', 'C:\\Users\\MILOUD~1\\AppData\\Local\\Temp\\video2x\\tmp4gp3r7_1']' returned non-zero exit status 3221225781.
- C:\Users\mr951\Downloads\video2x-4.8.1-win32-full\dependencies\ffmpeg\bin
- D:\video2x-4.8.1-win32-full\video2x-4.8.1-win32-full\dependencies\ffmpeg\bin
- Test
- [Errno 2] No such file or directory: 'C:\\Users\\cleon\\Videos\\gurafauna_output.mkv' HOT 1
- NVIDIA QUADRO RTX A2000 12GB 3 hour ETA NVENC inactive. What should I do?
- Command '['C:\\Users\\M ALi\\Downloads\\Compressed\\video2x-4.8.1-win32-full\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-ncnn-vulkan\\waifu2x-ncnn-vulkan', '-n', '2', '-s', '2', '-t', '400', '-m', 'C:\\Users\\M ALi\\Downloads\\Compressed\\video2x-4.8.1-win32-full\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-ncnn-vulkan\\models-cunet', '-g', '0', '-j', '1:1:1', '-f', 'png', '-i', 'C:\\Users\\MALI~1\\AppData\\Local\\Temp\\video2x\\tmpfrix5xcq', '-o', 'C:\\Users\\MALI~1\\AppData\\Local\\Temp\\video2x\\tmpbk98o9mj']' returned non-zero exit status 3221225781.
- 1
- Command '['E:\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-caffe\\waifu2x-caffe-cui', '--tta', '0', '--gpu', '1', '--batch_size', '1', '--crop_size', '128', '--output_depth', '24', '--output_quality', '2', '--process', 'gpu', '--model_dir', 'E:\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-caffe\\models\\ukbench', '--noise_level', '3', '--mode', 'auto_scale', '--output_extention', 'png', '--scale_width', '1760', '--scale_height', '1440', '--input_path', 'D:\\Temp\\tmpnk2m6spo\\0', '--output_path', 'D:\\Temp\\tmpv7lw_u_u']' returned non-zero exit status 1.
- Sequential identical frames
- Command '['C:\\Users\\ronak\\Downloads\\Compressed\\video2x-4.8.1-win32-full\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-caffe\\waifu2x-caffe-cui', '--tta', '0', '--gpu', '1', '--batch_size', '1', '--crop_size', '128', '--output_depth', '24', '--output_quality', '-1', '--process', 'cudnn', '--model_dir', 'C:\\Users\\ronak\\Downloads\\Compressed\\video2x-4.8.1-win32-full\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-caffe\\models\\cunet', '--noise_level', '3', '--mode', 'noise_scale', '--output_extention', 'png', '--scale_width', '3840', '--scale_height', '2160', '--input_path', 'C:\\Users\\ronak\\AppData\\Local\\Temp\\video2x\\tmp4zgj3b4y\\2', '--output_path', 'C:\\Users\\ronak\\AppData\\Local\\Temp\\video2x\\tmp2oz1eh45']' returned non-zero exit status 3221226505.
- input output path type mismatch
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 video2x.