New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import degrades mkv files #138
Comments
Yeah, you are right, I just used the catch all command to convert any file to mp4, not just mkv. What would be a good solution for that? Some kind of a mapping of file extension to optimal ffmpeg command? This way, even when ingesting media files with different file types, the mapping could look up the optimal command. Do you mind looking into it? Find the ideal ffmpeg command for the different filetypes? |
sure, i already got a python script that uses ffprobe to figure out what needs to be converted and what can be remuxed so I can cobble something together from that. |
Well... A PR would be even better! :-) I think you have found the So I was thinking to have an additional method for that class that takes the filename, looks at the file ending and returns the optimal ffmpeg command to be called. Or what do you think? |
https://gist.github.com/Cycor/e6e2a1c4e2d907bf7b1a552b7a417472 this is the script i'm using atm, it's still a work in progrss but for yt-dlp downloads it works fine. |
OK, I think we should focus on supporting conversion for three file types: mkv, webm, mov, maybe wmv? I don't know, but why not? So basically we just need the appropriate ffmpeg command that can convert each of these file types to standard mp4. Then we mention in the wiki, which filetypes are supported, and if people have something wired, they can still convert it them self's and ingest the mp4. Otherwise this will get out of hand quickly. :-) |
ffmpeg is insanely good, so I would just let it do it's thing, allow all known types, my script doesn't really look at the source except for if a recode or remux is needed, if it is needed it does a standard x264 conversion (hardware accelerated in my case but not needed) otherwise a copy, that works on all ffmpeg supported types, we just need to check the exitcode and result filesize to be sure if it worked. |
OK, sounds good, looking forward to your implementation! :-) |
@Cycor Were you able to look at this one? Just to make sure we don't end up doing double the work. :-) |
I'll try to push something this weekend, haven't gotten a lot of free time last week, got most of the code ready and I'm doing a bunch of test runs with weird codecs to get the best settings to keep the quality/subtitles/metadata etc and copy the data if possible. |
closing this for now, we can revisit that again when improving the offline import functionality. |
Any news regards this? |
Same state as mentioned in the wiki. I'm probably not going to extend the manual import any further for the foreseeable future. If you have any specific requirements, convert the videos first with your preferred settings. Or if you feel strongly about it, make a PR. |
When importing mkv files you are using
ffmpeg -i file.mkv file.mp4
this causes ffmpeg to recode the mkv instead of just remuxing it, reducing the quality.
I usually use this line to remux, but you might need to check if the codec can be used in an mp4 container
ffmpeg -i input.mkv -movflags +faststart -c:v copy -c:a copy -c:s copy -c:t copy ouput.mp4
The text was updated successfully, but these errors were encountered: