INTERACT FORUM

Please login or register.

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

Author Topic: Is there a field which gives Video Compression or Audio Compression ONLY?  (Read 639 times)

javidan

  • Junior Woodchuck
  • **
  • Posts: 76

I'm trying to rename my files with compression standards now that h265 is becoming more and more popular.

I am aware of the field [Compression] which typically gives something like "mkv video (video: h264, audio: ac3)"

Is there a field which gives only the Video portion by itself or the Audio portion? I gave up trying to do some string manipulation on the [Compression] field and I thought maybe it's there and I'm just not aware of it's existence.

i.e. I just want "h264" and "ac3" seperately...
Logged

RD James

  • Citizen of the Universe
  • *****
  • Posts: 1871

This code seems to work with all of the media formats in my library, though I don't use Regex that often, so it's possible that it breaks in some way or could be better written.
You can add it as an "expression column" or add it as a new field to the library.

Video Codec:
Code: [Select]
Regex([Compression, 0], /#:\s([-.\w\s]+)\,#/, 1, 0)

Audio Codec:
Code: [Select]
FirstNotEmpty(Regex([Compression, 0], /#:\s([-.\w\s]+)\)#/, 1, 0), [Compression, 0])
Logged

javidan

  • Junior Woodchuck
  • **
  • Posts: 76

Oh my goodness, thank you SO MUCH!

I knew that this was going to be a pain in the *** for me the moment I realised Regex was literally the only option I had to deal with String manipulation more than just removing a fixed number of chars from anything I want to fiddle with.

Will try it.

Thank you so much again!
Logged
Pages: [1]   Go Up