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)
- How to use custom config with the docker container image.
- Video2x needs the ability to process a list of folders with each folder in different resolutions and you should set a pause between files for your overheating GPU.
- Command '['C:\\Users\\USER\\Desktop\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-caffe\\waifu2x-caffe-cui', '--tta', '0', '--gpu', '0', '--batch_size', '1', '--crop_size', '128', '--output_depth', '24', '--output_quality', '-1', '--process', 'gpu', '--model_dir', 'C:\\Users\\USER\\Desktop\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-caffe\\models\\upconv_7_anime_style_art_rgb', '--noise_level', '3', '--mode', 'noise_scale', '--output_extention', 'png', '--scale_width', '1280', '--scale_height', '960', '--input_path', 'C:\\Users\\USER\\AppData\\Local\\Temp\\video2x\\tmpw5w7yujg\\0', '--output_path', 'C:\\Users\\USER\\AppData\\Local\\Temp\\video2x\\tmp159x_ymr']' returned non-zero exit status 1.
- Error: 'video2x.upscale(input_file, output_file' & 'get basic video information'
- Command '['C:\\Users\\arzum\\OneDrive\\Рабочий стол\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-caffe\\waifu2x-caffe-cui', '--tta', '0', '--gpu', '0', '--batch_size', '1', '--crop_size', '128', '--output_depth', '24', '--output_quality', '-1', '--process', 'gpu', '--model_dir', 'C:\\Users\\arzum\\OneDrive\\Рабочий стол\\video2x-4.8.1-win32-full\\dependencies\\waifu2x-caffe\\models\\cunet', '--noise_level', '3', '--mode', 'noise_scale', '--output_extention', 'png', '--scale_width', '1440', '--scale_height', '1080', '--input_path', 'C:\\Users\\arzum\\AppData\\Local\\Temp\\video2x\\tmpgja_t4mj\\0', '--output_path', 'C:\\Users\\arzum\\AppData\\Local\\Temp\\video2x\\tmp_gvqc1tv']' returned non-zero exit status 1.
- Automatically delete original file immediately after processing original file successfully - optional feature requirement HOT 1
- Command '['C:\\Users\\Md Rasel\\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\\Md Rasel\\Downloads\\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\\MDRASE~1\\AppData\\Local\\Temp\\video2x\\tmp_9rr4wmq', '-o', 'C:\\Users\\MDRASE~1\\AppData\\Local\\Temp\\video2x\\tmp_ha7k59f']' returned non-zero exit status 3221225781.
- When i try to upscale an image or video, it shows returned non zeroexit status 259
- C:\Windows\system32\dependencies\ffmpeg\bin
- Command '['D:\\DOWNLOAD\\video2x-4.8.1-win32-full\\dependencies\\realsr-ncnn-vulkan\\realsr-ncnn-vulkan', '-s', '4', '-t', '0', '-m', 'D:\\DOWNLOAD\\video2x-4.8.1-win32-full\\dependencies\\realsr-ncnn-vulkan\\models-DF2K_JPEG', '-g', '0', '-j', '1:1:1', '-f', 'png', '-i', 'C:\\Users\\chris\\AppData\\Local\\Temp\\video2x\\tmp4egb3jec', '-o', 'C:\\Users\\chris\\AppData\\Local\\Temp\\video2x\\tmp0mppbb7q']' returned non-zero exit status 3221226505.
- GUI might need some work
- 'NoneType' object has no attribute 'split'.
- 'NoneType' object has no attribute 'split'
- TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'
- Command '['dependencies\\ffmpeg\\bin\\ffmpeg', '-hwaccel', 'auto', '-y', '-i', 'C:\\Users\\azeem\\OneDrive\\Documents\\ytvideos (and oh, sources for recreations)\\GA_MOVIE.mp4', '-pix_fmt', 'rgb24', 'C:\\Users\\azeem\\AppData\\Local\\Temp\\video2x\\tmp9s2n0je4\\extracted_%0d.png']' returned non-zero exit status 1. HOT 1
- WSL2 Docker Exception: process died unexpectedly
- Slow Speed with RTX 4090
- C:\WINDOWS\System32\dependencies\ffmpeg\bin
- Request support for Real ESRGAN
- anime4k not working in Docker image HOT 2
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.