On Windows, when you look at "Details" tab for an mp4 file, there is a "Parental rating" field which seems to be free text. I am trying to set that to "PG", "R", etc. for my movies.
The mutagen python module has a "rtng" tag, described as Content Rating, with an integer value. I am assuming these two attributes are related, and somehow there is a mapping from integer to an actual rating?
If that's true, I tried this:
from mutagen.mp4 import MP4
f = 'myfile.mp4'
mp4_video_tags = MP4(f)
mp4_video_tags['\xa9nam'] = 'My Title is long'
mp4_video_tags['\xa9gen'] = 'My Genre1; My Genre2'
mp4_video_tags['\xa9day'] = '1919'
mp4_video_tags['\xa9cmt'] = 'My Comments are very long'
mp4_video_tags['rtng'] = 1
mp4_video_tags.save()
print(mutagen.File(f))
Everything works, except "mp4_video_tags['rtng'] = 1". I get
mutagen.mp4.MP4MetadataValueError: 'int' object is not iterable
When I tried quoting the '1':
mp4_video_tags['rtng'] = '1'
I get another error:
mutagen.mp4.MP4MetadataValueError: value out of range: '1'
So my questions are
- Is the Parental rating attribute on the file set through 'rtng'?
- How to set 'rtng' correctly?
- What are the integer values for G, PG, PG13, R, etc?