Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mp4 file with extra tags results in incorrect output from AtomicParsley #65

Open
ghjimmy opened this issue Apr 6, 2023 · 4 comments
Open

Comments

@ghjimmy
Copy link

ghjimmy commented Apr 6, 2023

Looks like if a non standard tag is added by, for example, ffmpeg, AtomicParsley reports on all of the tokes, but called them the empty string. If the example below I've removed the extraneous ffprobe output:

$ AtomicParsley file.mp4 -t
Atom "©nam" contains: Title
Atom "©too" contains: Lavf58.20.100
Atom "©cmt" contains: Comment
Atom "©day" contains: 2023
Atom "desc" contains: Description
$ ffprobe -i file.mp4 -print_format json -show_format
 < deleted >
    "format": {
        "filename": "file.mp4",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "2100.235000",
        "size": "362797503",
        "bit_rate": "1381931",
        "probe_score": 100,
        "tags": {
            "major_brand": "isom",
            "minor_version": "512",
            "compatible_brands": "isomiso2avc1mp41",
            "creation_time": "2023-04-03T03:06:47.000000Z",
            "title": "Title",
            "encoder": "Lavf58.20.100",
            "comment": "Comment",
            "date": "2023",
            "description": "Description"
        }
    }

Now add an extra tag to the file and re-run AtomicParsley and ffprobe again

$ ffmpeg -i file.mp4 -movflags use_metadata_tags -metadata newTag="newTag" -c copy file2.mp4 >/dev/null 2>&1
$ AtomicParsley file2.mp4 -t
Atom "" contains: isom
Atom "" contains: 512
Atom "" contains: isomiso2avc1mp41
Atom "" contains: Description
Atom "" contains: Title
Atom "" contains: newTag
Atom "" contains: Comment
Atom "" contains: 2023
Atom "" contains: Lavf59.27.100
$ ffprobe -i file2.mp4 -print_format json -show_format
 < deleted >
    "format": {
        "filename": "file2.mp4",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mov,mp4,m4a,3gp,3g2,mj2",
        "format_long_name": "QuickTime / MOV",
        "start_time": "0.000000",
        "duration": "2100.199000",
        "size": "362797671",
        "bit_rate": "1381955",
        "probe_score": 100,
        "tags": {
            "minor_version": "512",
            "major_brand": "isom",
            "compatible_brands": "isomiso2avc1mp41",
            "description": "Description",
            "title": "Title",
            "newTag": "newTag",
            "comment": "Comment",
            "date": "2023",
            "encoder": "Lavf59.27.100"
        }
    }

@github-actions
Copy link

github-actions bot commented Apr 6, 2023

Thanks for filing an issue! Please note that this project is only passively maintained, so your best bet for getting an issue resolved is through a pull request that is easy to verify! Please read this for more information.

@howyallare
Copy link
Contributor

This is a known incompatibility. As an alternative, you can use AtomicParsley to added custom tags using --rDNSatom. However, you'll need to build AP with the fix in PR #63, which fixes a problem in parsing .--rDNSatom values. The PR is a bit messy because the submitter didn't squash commits, but the end result appears to to work.

@ghjimmy
Copy link
Author

ghjimmy commented May 22, 2023

The issue is a 3rd party program (Topaz Video AI) adding these tags via ffmpeg, and then making the file incompatible for AtomicParsley. Currently, I make a "best guess" at what the tags are from parsing ffprobe and re-add the compatible ones with "AtomicParsley --metaEnema --artwork REMOVE_ALL" but I was hoping there was a workaround in AtomicParsley to parse them correct. I'll look at the PR you mentioned to preserve the extra tags when I write them in a more compatible format. Currently, I just write them as extended attributes to the file itself, just so I can preserve them.

@howyallare
Copy link
Contributor

The use of -movflags use_metadata_tags triggers ffmpeg to write the tags in a form that is unreadable for Windows Explorer, Mp3Tag, Kid3, AtomicParsley and other applications, so no shortcut that I could see. Also, there are some differences in how applications handle reverse DNS tags with multiple values, so some care is required if you're writing tags in different applications.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants