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
Use MediaInfo to extract resolution to determine quality before falling back to extension #448
Comments
Comment from ogimoore on Trello: +1ing this feature. Using file extension in absence of a file name addition specifying the video quality is far from ideal, especially considering mediainfo is already built into Sonarr (from my understanding). I just had Sonarr bring in ~11,000 files, and almost all of them just defaulted to HDTV-720 due to my mkv extension. |
Comment from zoggy on Trello: @ogimoore majority of people get their releases from 'scene' which have pretty set guide/rules and dont really change containers very often. Thus it is pretty safe to assume that .mkv is hdtv and .mp4/avi is sdtv and .ts is rawhd. Now if the user doesnt like the 'assuming' they can provide a bit more info in the naming pattern of said files (quality) to prevent this. Can set quality after the fact and fix it later by having sonarr rename files. But anyways, using mediainfo is good but there is a hit that comes with it. Not everyone stores the files locally, a prime example would be bitcasa where the files 'appear' local but are actually remote. (fusefs) Thus if you want to run the file through mediainfo it has to download the file.. which can be costly. |
Comment from zoggy on Trello: @leeovery1 sb stores the original release names so previous info can still be referred to when renaming. thus you could just go add the quality to your naming pattern and have sb rename to put it in. thus when you import into sonarr, it will know what it is. then at that time you could then rename files again in sonarr to discard that info from the filename if you really dont want it there. (who even looks at filenames anymore in their media player?) |
Comment from ogimoore on Trello: @zoggy Thanks for the reply. I can't speak to everyones usage of Sonarr, as I can only discuss my case, which is where I have a significant blu-ray rip library done with makemkv (so no transcoding, just a rip to disk), however as the end file is saved as a mkv, Sonarr associates that with a 720p file (despite being a 10GB file for an hour long episode). I am worried that Sonarr may see a 1080p file on an indexer and think that an upgrade is available and download/overwrite the file that I ripped. I understand this can be potentially avoided through adding the quality to the file name (something I suppose I should consider changing up in the future)... I don't have a feel at all for what the computational cost is associated with doing a mediainfo scan on each file Sonarr handles to determine what the quality of a video file is, so I cannot speak to that. Thanks for the reply. A designer knows he has arrived at perfection not when there is no longer anything to add, but when there is no longer anything to take away. -- Antoine de Saint-Exupery |
Comment from zoggy on Trello: the 'files' on a indexer are releases folders not actual files. thus the extension is not really known. so they can only go off the release name..which normally has a quality string in it. if it doesnt, 'unknown' is assumed. unknown qualities would not replace anything you have, unless forced/requested specifically. thus your concerns of a post-processing logic does not apply to the searching logic. plus sonarr has the ability to apply size filters to said quality to weed out things. |
Comment from markus101 on Trello: @ogimoore even with media info at best it would detect HDTV 1080p for a file that has a .mkv extension with a resolution of 1920x1080, its not going to be able to figure out that its actually a BR Rip without that info in the file name. Your concern is valid and will be an issue as long as the episode is monitored (wanted), but only overcome by having the info in the file names during import. |
Comment from 0ne0fmany on Trello: Another vote for this. I just started using Sonarr in place of Sickbeard and this is a huge issue. I record local channels OTA using Silicon Dust HD Homeruns, which record to .MPG files and then Sonarr/Sickbeard for anything which is missed or had errors. A half hour show averages around 3-4GB from OTA. Sonarr flags these 1080P files as SDTV and wants to replace them with 500MB 720P files. The program I use to record them doesn't have any method for adding a quality to the filename, so I'm kinda screwed unless I want to manually change the quality setting. I'll keep monitoring this card, but I'll have to head back to Sickbeard until then. I really like Sonarr otherwise! |
Comment from markus101 on Trello: @0ne0fMany if you're always recording 1080p then you could just add that to all file names. |
Comment from 0ne0fmany on Trello: @markus101 Thanks for the speedy comment on this. The program I'm using for recording (SageTV) doesn't have an option to change the default naming convention, which means I'd need to use a batch file after the fact and would first need to check if a file had already been renamed. There are also associated files (edl, txt, etc) which are created for various reasons and would also need to be renamed to match. I'm not a programmer, so this seems quite difficult to accomplish. |
Comment from m0ul on Trello: this would be very useful, since i have allot of anime geting imported as unkown |
Saw this issue has been migrated to github. Just posting to see if this is on the table currently. Currently my file naming scheme is: {Series Title} - S{season:00}E{episode:00} - {Episode Title} I am considering using FileBot to rename all my episodes in such a way that Sonarr can properly detect quality. I did notice that under Settings -> Media Management -> File Management there is an option to "Analyse video files". Am I correct to understand that some functionality like this issue describes is already integrated? |
I asked myself the same question. |
No it does not. the MediaInfo is currently only used for renaming. |
Anything new to this? |
Just want to add that this has been a major headache for me. Moved Sonarr from a Windows platform to Linux which was a complete disaster. Had to rebuild the entire database from scratch, like using Sonarr for the first time again (WTF?). It detected every existing series episode as 720p. There doesn't seem to be a way to manually mass edit files, and clicking one at a time on like 500 episodes is ridiculous. It'd be easier to directly edit the db with a query which shouldn't be necessary. Using mediainfo does incur a performance hit, and for some users working with remote files this is a real problem. However, there is no reason using mediainfo has to be mandatory or even the default. Just having it as an option would help a lot of users in situations like myself, or users converting from SickXXXX to Sonarr. At the very least, if using MI is distasteful, Full season/show quality mass editing within the GUI would be really helpful. |
@Taloth glad to hear the issue is still being considered. I don't know if I will be of much help coding (maybe a little?) but if there is something that I can do to help (testing?) let me know and I'll be happy to assist. |
+1 |
I also made a comment under #457. When scanning files, Sonarr detects iTunes 720p files as SDTV due to the (HD) marker, which is iTunes only puts the resolution in the 1080p files. eg.: SD = 1-01 Pilot.m4v I thought if this is not something that can be automatically done, then maybe since people often have their own naming conventions there could be a place on the Quality Definitions settings page (on the right of each line after the size limit sliders) for people to specify their only quality filename markers or naming convention for each specific quality. |
+1, should be part of the "Analyse video files" feature |
Would definitely love "Analyse video files" feature (just migrated so everything is now 720p 😢 ) |
I understand that this issue seems to somehow not get a lot of traction with developers. I'm not sure why, other than the fact that one could add a general "720p" "1080p" monikers as defaults, fall back to media info, then have Sonarr recognize that sometimes it isn't going to know HDTV or BRip or anything else, but still should recognize that they are HD files. I've had this problem for a while myself. I use a program called iVI Pro to convert everything I download into a format suited for my needs (also sets metadata within the mp4 format) this renames the files as it does, which is nice because occasionally files come across my desk that are named really strange things, so those files go into a kind of purgatory waiting for me to tell iVI Pro what they are. Once this happens, iVI Pro sets a naming scheme that works for, well, nearly anything. It can't be that hard, I'm personally considering writing a Python Script of my own to get some renaming done, which should be trivial. Developers could also allow people to specify what they want the default to be rather than hard-coding it in, I don't think it is fair to assume that anything with the mp4 or m4v extensions is SD, or that all mkv files are 720p, to me that is just plain lazy (no offense) when SO MANY other methods can be used to determine resolution trivially! Please, developers, just add the ability to do this simple yet powerful task. |
+1 Just migrated and started to use the excellent sickbeard_mp4_automator and ALL my files are marked as SD. Badly needed feature. |
Any update on this issue? |
Some thoughts regarding the implementation: This shouldn't be tied to "quality parsing" since it's not parsing the quality, but enhancing what was parsed. In some ways this fits with the advanced parser (#457), though it could be done without the work required for that, the advanced parser would clean up some of the implementation though.
|
New: Use media info during import to extract resolution for quality Closes #448
New: Use media info during import to extract resolution for quality Closes #448
Just another confirmation of problems that the lack of this feature can cause... As @Arkymedes also noted, when using sickbeard_mp4_automator, all converted files are tagged as SDTV after conversion. This may then cause a re-download since SDTV doesn't match the required quality. For example: Thanks for your efforts! |
For those interested, I've created a script that, while it doesn't really solve this problem, will hopefully help users who are struggling with this issue. https://github.com/TheFirstQuestion/VideoResolutionRenamer Any feedback is appreciated! If my code can assist in adding this feature to Sonarr, that would be wonderful. |
@markus101 Any ETA for when PR #2146 will be merged and released? This one is super annoying. Thanks for your efforts! |
New: Use media info during import to extract resolution for quality Closes #448
New: Use media info during import to extract resolution for quality Closes #448
New: Use media info during import to extract resolution for quality Closes #448
New: Use media info during import to extract resolution for quality Closes #448
Any progress on this? I had my drivepool disconnected due to an issue and sonarr basically reset all my files to 720p quality when everything was resolved even though the vast majority is 1080p. This is an issue because now its starting to download things I already have. |
New: Use media info during import to extract resolution for quality Closes #448
I see this is marked closed, again, but I just migrated from Windows to Ubuntu, and I can tell you that it is absolutely not working. all MP4s are marked as SD and ALL MKVs are marked as 720p. |
I just started to setup Sonarr and came here just to find this. All my existing series (mkv) are marked 720p. What a complete disappointment. Unfortunately, this is a deal breaker for me using Sonarr. I would have thought the ability to analyze files would have already been in a project this mature. |
If you're having issues with an implemented feature open a thread on the forums for support. |
The feature to process mediainfo to determine the resolution was released in version 5225/5228 around mid june 2018. But it's not going to be as accurate as a filename tag since you can't determine hdtv/web/bluray etc from mediainfo. Nevertheless, if you encounter specific issues with it, please post it on the forums. |
Thank you, I will. I am pretty certain it isn't working - I don't expect it to figure out "source" for items I have, but it definitely hasn't tagged any mkv as at least 1080p which I have most of. Duly noted file name is the best option. |
Those forums are useless. The way to report open source bugs is via a github issue. The issue here still exists. Stop trying to shoe people way to a dead end. |
I ended up writing my own script to inspect the quality and append it to the filenames when I had to rebuild my sonarr database. The mediainfo support as it is today is beyond useless. I don't care about bluray/hdtv/etc, I mostly just wanted the resolution to be reflected correctly since that is what I'm replacing poor-quality files based on. |
Absent any proof it being beyond useless means absolutely nothing... I ran a couple sample files through and they worked exactly how they should: Both files in Season 1 are 1080p files and the file in season 2 is 2160p. For files already in the series folder If it's not working for your please provide information that we can use to actually fix it. @biship I get it, you don't like the forums, but your comment provides no value to the discussion. We'll continue to use the forums for support and github to track issues/bugs. |
Right now we fallback to file extension to determine the quality of an episode file if the filename doesn't contain any quality information.
We should instead check the file with MediaInfo to determine the quality based on the resolution and fallback to extension if the resolution cannot be extracted.
The text was updated successfully, but these errors were encountered: