Skip to content

Error: lxml.etree.XMLSyntaxError: Extra content at the end of the document #12

Description

@ChakshuGupta13

While using script over a folder which may contain other files as well, encountered following:

=========================
[30/10/2024 23:27:49] [WARNING] [IMG_2667] - Make sure to have a backup of your image and/or video file
[30/10/2024 23:27:49] [INFO] [IMG_2667] - Live Photo keyframe track number: 4
[30/10/2024 23:27:49] [INFO] [IMG_2667] - Live Photo keyframe: 1401667us
Traceback (most recent call last):
  File "...motionphoto2.py", line 128, in <module>
    ).mux()
      ~~~^^
  File "...Muxer.py", line 238, in mux
    self.merge_xmp(result)
    ~~~~~~~~~~~~~~^^^^^^^^
  File "...Muxer.py", line 171, in merge_xmp
    xmp = lxml.fromstring(xmp)
  File "src/lxml/etree.pyx", line 3306, in lxml.etree.fromstring
  File "src/lxml/parser.pxi", line 1995, in lxml.etree._parseMemoryDocument
  File "src/lxml/parser.pxi", line 1875, in lxml.etree._parseDoc
  File "src/lxml/parser.pxi", line 1105, in lxml.etree._BaseParser._parseUnicodeDoc
  File "src/lxml/parser.pxi", line 633, in lxml.etree._ParserContext._handleParseResultDoc
  File "src/lxml/parser.pxi", line 743, in lxml.etree._handleParseResult
  File "src/lxml/parser.pxi", line 672, in lxml.etree._raiseParseError
  File "<string>", line 1
lxml.etree.XMLSyntaxError: Extra content at the end of the document, line 1, column 2541

I tried to see xmp - maybe it will help later:

[30/10/2024 23:39:47] [INFO] [IMG_2667] - XMP of original file: <?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 6.0.0"> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> <rdf:Description rdf:about="" xmlns:xmp="http://ns.adobe.com/xap/1.0/" xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/" xmp:CreateDate="2023-09-09T19:26:04" xmp:CreatorTool="16.6.1" xmp:ModifyDate="2023-09-09T19:26:04" photoshop:DateCreated="2023-09-09T19:26:04"/> </rdf:RDF> </x:xmpmeta>  

Weirdly, it works next time when video file is re-copied from source for second run.

=========================
[30/10/2024 23:55:24] [WARNING] [IMG_2667] - Make sure to have a backup of your image and/or video file
[30/10/2024 23:55:24] [INFO] [IMG_2667] - Live Photo keyframe track number: 4
[30/10/2024 23:55:24] [INFO] [IMG_2667] - Live Photo keyframe: 1401667us
[30/10/2024 23:55:24] [INFO] [IMG_2667] - XMP metadata - copying attribute {http://www.w3.org/1999/02/22-rdf-syntax-ns#}about
[30/10/2024 23:55:24] [INFO] [IMG_2667] - XMP metadata - copying attribute {http://ns.google.com/photos/1.0/camera/}MotionPhoto
[30/10/2024 23:55:24] [INFO] [IMG_2667] - XMP metadata - copying attribute {http://ns.google.com/photos/1.0/camera/}MotionPhotoVersion
[30/10/2024 23:55:24] [INFO] [IMG_2667] - XMP metadata - copying attribute {http://ns.google.com/photos/1.0/camera/}MotionPhotoPresentationTimestampUs
[30/10/2024 23:55:24] [INFO] [IMG_2667] - Writing output file: ...IMG_2667.HEIC

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions