INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Metadata for distinguishing video types?  (Read 1100 times)

Trumpetguy

  • Citizen of the Universe
  • *****
  • Posts: 974
Metadata for distinguishing video types?
« on: June 18, 2020, 01:52:12 am »

Is there a simple (or recommended) way to tag video files according to technical category? I am looking for a method to have a filter criterion between bluray vs 4KUHD vs DVD vs various mobile videos etc. My primary need is to distinguish 4kUHD from BR. I looked through the metadata list, and did not find anything. Could it be possible to add colour depth 8/10bit?

This has become more of a need after I started buying 4K UHD's. We play video on different places in the house and on mobiles, but only the home theater is equipped to tone map UHD, and it would be nice to filter these movies out or at least tag them for all users to know.
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Metadata for distinguishing video types?
« Reply #1 on: June 18, 2020, 02:35:26 am »

You said you looked through the metadata list. Have you looked at the Dimensions field?
Logged

EnglishTiger

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 1084
Re: Metadata for distinguishing video types?
« Reply #2 on: June 18, 2020, 02:46:46 am »

Unlike some Media Players MC not only allows you to use the tags it already knows about in a way that satisfies your personal requirements it also allows you to add your own tags.

One way of being able to distinguish between 4kUHD and BR would be to add that distinguishing info to one of the tags Video Files already uses in a way that does not prevent an Internet Search for additional information failing.
A second way would be to look for a suitable existing tag/field that none of the other existing media types in your Media Collection uses and repurpose it.
The 3rd way is to Add a suitably named New Tag.

All 3 methods will work if it is MC that is controlling the streaming to your other devices, but the 2nd and 3rd options may will not work if the decision about what to stream is being made by the "receiving device".

Logged
Apple Mac Mini Desktop Computer with M4 Pro chip with 12 core CPU and 16 core GPU: 24GB Unified Memory, 512GB SSD Storage, Gigabit Ethernet, 3 Thunderbolt5 + 2USBC ports.

Trumpetguy

  • Citizen of the Universe
  • *****
  • Posts: 974
Re: Metadata for distinguishing video types?
« Reply #3 on: June 19, 2020, 08:40:04 am »

You said you looked through the metadata list. Have you looked at the Dimensions field?

Bummer, actually I didn't think of that  ::) Was too occupied focussing on colour bit depth could do the job.

Thanks!

Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Metadata for distinguishing video types?
« Reply #4 on: June 19, 2020, 08:59:13 am »

I have created new calculated field [Definition] which return 4K, 1080p, 720p, 576p, 480p depending on width and on SD depending on framerate to separate PAL and NTSC

Code: [Select]
IfElse(IsEqual([Width],1920,5),4K,IsEqual([Width],1360,5),1080p,IsEqual([Width],888,5),720p,IsEqual(Replace([FPS],/,,.),25,2),576p,1,480p)
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Metadata for distinguishing video types?
« Reply #5 on: June 19, 2020, 12:04:49 pm »

Bummer, actually I didn't think of that  ::) Was too occupied focussing on colour bit depth could do the job.

Thanks!

Glad to help...
Logged

arcspin

  • Galactic Citizen
  • ****
  • Posts: 391
Re: Metadata for distinguishing video types?
« Reply #6 on: June 19, 2020, 02:19:33 pm »

I have created new calculated field [Definition]

WOW,
This is just great, thank you for this expression!
Logged
Hardware: Intel Core i5-8600K 16GB RAM, ASUS GeForce RTX 2080 8GB DUAL OC
Software: Windows 10 Home 64-bit, version 2004, JRiver MC 29, MadVr 0.92.17 (Beta 113), NVIDIA driver 457.09
Projector: JVC DLA-I X5500 (RS420, X570R) -
Screen: DNP Supernova 08-85
Processor: Anthem AVM 70
Power amp: XTZ A2-400 for Front & Center - XTZ A2-300 for Surround & Height channels
Speakers: Arendal 1723 S Monitor for Front & Center, Linn Unik for Front Height, Rear Height, Surround & Surround back. Elipson Planet M for Top Middle.
Sub: Arendal 1723 1S

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Metadata for distinguishing video types?
« Reply #7 on: June 21, 2020, 03:29:16 pm »

Code: [Select]
IfElse(IsEqual([Width],1920,5),4K,IsEqual([Width],1360,5),1080p,IsEqual([Width],888,5),720p,IsEqual(Replace([FPS],/,,.),25,2),576p,1,480p)
If you're interested in it arcspin, this expression can be simplified in a couple of ways to make it easier to read, especially by using [Height] instead of [Width].

One way is to use the new IfCase function, so that you don't have to keep writing the IsEqual expression:
Code: [Select]
IfCase([Height],2,2160,4K,1080,1080p,720,720p,576,576p,480,480p)
But since the output desired is so simple, and the function assumes progressive, instead of testing for progressive vs interlaced, then it can actually be simplified even further.  Except for outputting 2160p instead of 4K, this gives equivalent results:

Code: [Select]
[Height]p
I don't think it can be simplified further than that... :)
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Metadata for distinguishing video types?
« Reply #8 on: June 21, 2020, 03:55:32 pm »

Except if you have re-encoded and cropped your videos then using height becomes more unreliable as mostly it is height which is trimmed...
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Metadata for distinguishing video types?
« Reply #9 on: June 21, 2020, 04:02:24 pm »

If you want something thats very reliable, you would likely have to check both Width and Height. Height can change when a video is cropped, and Width can vary based on aspect ratio. eg. an old 4:3 movie in 720p can be 960x720
Logged
~ nevcairiel
~ Author of LAV Filters

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Metadata for distinguishing video types?
« Reply #10 on: June 21, 2020, 04:10:10 pm »

If you want something thats very reliable, you would likely have to check both Width and Height. Height can change when a video is cropped, and Width can vary based on aspect ratio. eg. an old 4:3 movie in 720p can be 960x720
That's true.
However my definition expression determines video as 720p if video width more than it would be for SD video so it works for me, I don't dare to say every time but I haven't noticed any glitches 'till today. That doesn't mean there aren't  ;D
Logged

wer

  • Citizen of the Universe
  • *****
  • Posts: 2640
Re: Metadata for distinguishing video types?
« Reply #11 on: June 21, 2020, 04:15:44 pm »

I don't crop and reencode my videos, so it's not an issue for me.

But if one were going to do that, for maximum accuracy one would need to store the original pre-crop resolution in a separate field.  Cropping/resizing/transcoding could do anything.
Logged

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Metadata for distinguishing video types?
« Reply #12 on: June 21, 2020, 04:22:00 pm »

Well, If I re-encode 1920x1080 video to 1920x800 because I trimmed black bars out, I still consider it as a 1080p video in my library. Reasoning being that it cannot be shown on "hd ready" TV at full its resolution. Not that I have such TV  :D

But if I do other than just crop black bars and resize the picture then of course definition for that new video should be different like 720p when resized to e.g. 1280x544

But enough off topic from me. Sorry about that
Logged

Hendrik

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 10935
Re: Metadata for distinguishing video types?
« Reply #13 on: June 21, 2020, 04:39:06 pm »

However my definition expression determines video as 720p if video width more than it would be for SD video so it works for me, I don't dare to say every time but I haven't noticed any glitches 'till today. That doesn't mean there aren't  ;D

If you consider cases where videos were re-encoded, this could happen:

960x720 -> 4:3 720p
1024x576 -> 16:9 PAL SD

Obviously PAL SD is always originally 720x576 and if it needs to be 16:9 then its anamorphic, but if some player or device doesn't like anamorphic, the result of a scale to get rid of it would be that resolution.
Its a bit of a contrived example, but it definitely happened before, which is why in code when I need to "guess" a "definition", i use H > 576 or W > 1024 to make it  "HD", and not just one of them. :)
Logged
~ nevcairiel
~ Author of LAV Filters

lepa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 2033
Re: Metadata for distinguishing video types?
« Reply #14 on: June 21, 2020, 05:34:11 pm »

1024x576 would break and yes I have 4 videos from national broadcasting streaming service which has encoded 16/9 SD into that resolution so that is one case where expression fails.

Now that you mention it I think that I did notice it also before but didn't bother complicate things for couple of movies sake. Now that we have Or() function it is though easy to fix

Code: [Select]
IfElse(Compare([Width],>,1920),4K,Compare([Width],>,1360),1080p,Or(Compare([Width],>,1024),Compare([Height],>,576)),720p,Compare(Left([FPS],2),=,25),576p,1,480p)
Logged
Pages: [1]   Go Up