Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Video Metadata Question
#5
(Jul-20-2018, 08:35 PM)malonn Wrote: so I guess I'll try writing a simple parser(?). Is there such a thing as a "simple" one?
I've never done anything with binary data in Python
Then the simplicity goes out the windows,if try to do this from the binary data.
If want to it as a excises with .mkv files look at specifications @DeaD_EyE posted.
Can try to just find video dimensions to see how that goes.

Can look at eyeD3 that dos this from mp3 files.
There will find many places file read eg tag.py.
mode = "rb+" if os.path.isfile(self.file_info.name) else "w+b"
with open(self.file_info.name, mode) as tag_file:
    # Write the tag over top an original or append it.
    try:
        tag_file.seek(-128, 2)
        if tag_file.read(3) == b"TAG":
            tag_file.seek(-128, 2)
        else:
            tag_file.seek(0, 2)
    except IOError:
        # File is smaller than 128 bytes.
        tag_file.seek(0, 2)

    tag_file.write(tag)
    tag_file.flush()
As excepted the file get read in binary rb,the try to figure how to navigate/search the binary date to get to the needed metadata.
Reply


Messages In This Thread
Video Metadata Question - by malonn - Jul-20-2018, 03:53 PM
RE: Video Metadata Question - by DeaD_EyE - Jul-20-2018, 04:54 PM
RE: Video Metadata Question - by snippsat - Jul-20-2018, 06:37 PM
RE: Video Metadata Question - by malonn - Jul-20-2018, 08:35 PM
RE: Video Metadata Question - by snippsat - Jul-20-2018, 09:51 PM
RE: Video Metadata Question - by malonn - Jul-20-2018, 11:23 PM
RE: Video Metadata Question - by snippsat - Jul-21-2018, 12:41 AM
RE: Video Metadata Question - by malonn - Jul-21-2018, 01:26 AM
RE: Video Metadata Question - by malonn - Jul-21-2018, 05:17 PM
RE: Video Metadata Question - by malonn - Jul-21-2018, 08:26 PM
RE: Video Metadata Question - by malonn - Jul-23-2018, 04:04 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question image manipulation (cropping and MetaData) SpongeB0B 4 1,305 Jul-03-2023, 06:35 PM
Last Post: SpongeB0B
  AttributeError: 'function' object has no attribute 'metadata 3lnyn0 5 4,923 Mar-28-2022, 04:42 PM
Last Post: Larz60+
  Adding Language metadata to a PDF programmatically bhargavi22 0 2,000 Aug-17-2020, 12:53 PM
Last Post: bhargavi22
  METADATA Errors millpond 0 1,995 Jul-21-2020, 08:22 AM
Last Post: millpond
  How to sort image files according to a metadata file? Brahmslove 1 3,215 Dec-05-2019, 11:25 PM
Last Post: scidam
  Parse the data in XML metadata field klllmmm 2 3,400 Jun-19-2019, 04:24 PM
Last Post: klllmmm
  Tiff metadata sudecki 1 25,162 Aug-10-2018, 07:08 AM
Last Post: sudecki
  I have a question from a YouTube video I saw: nelsonkane 9 5,410 Dec-27-2017, 11:17 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020