You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JSON report on windows not escaping file path #817
The json report generated by mediaconch does not escape the file path backslashes for Windows file paths in MediaConch.media.ref field which results in malformed formatted json on Windows.
MediaConch.exe dummy\bars.mp4 --Output-Json=dummy.json will generate the following json
{
"MediaConch": {
"version": "0.2",
"verbosity": 5,
"creatingApplication": {
"name": "MediaConch",
"version": "25.04",
"url": "https://mediaarea.net/MediaConch"
},
"media": [
{
"ref": "dummy\bars.mp4",
"implementationChecks": [
{
"pass_count": 0,
"info_count": 0,
"warn_count": 0,
"fail_count": 0,
"checks_run": 0,
"name": "MediaConch Implementation Checker does not support AVC as found in Video track"
}
]
}
]
}
}
"ref": "dummy\bars.mp4", does not escape the backslash. JSON reads \b in the filename as an escape character instead of a backslash.
Since Windows uses backslashes for paths, this is only a problem on Windows machines. This should either escape the backslash character with a second backslash or the ref field should use the unix style paths aka forward slash.
I have tested this on both 25.04 and on latest commit.
on windows. "ref": "dummy\bars.mp4" should be "ref": "dummy\\bars.mp4". In fact any value with a backslash when serialized as json should be escaped with a double backslash.
Created a PR that updates Source/Resource/displays/MediaConchJson.xsl to correctly escape the ref value. However, this file seems to an input for a generation step to create Source/Common/generated/ImplementationReportDisplayJsonXsl.h. What are you doing here to generate it as a constant?
If you are okay with using Catch2 testing framework, I'm willing to get a test suite started for you.
I tend to prefer gtest because I already worked with it in the past, but well... The person who does the job is permitted to choose the framework (within limits of complexity and being well known... Catch2 is acceptable).
Activity
henryborchers commentedon Jun 8, 2026
on windows.
"ref": "dummy\bars.mp4"should be"ref": "dummy\\bars.mp4". In fact any value with a backslash when serialized as json should be escaped with a double backslash.henryborchers commentedon Jun 9, 2026
@JeromeMartinez any objection to me adding a test suite for MediaConch to catch runtime error like this?
JeromeMartinez commentedon Jun 9, 2026
We are definitely late on test suites, something we should do at some point.
henryborchers commentedon Jun 10, 2026
If you are okay with using Catch2 testing framework, I'm willing to get a test suite started for you.
henryborchers commentedon Jun 10, 2026
Created a PR that updates Source/Resource/displays/MediaConchJson.xsl to correctly escape the ref value. However, this file seems to an input for a generation step to create Source/Common/generated/ImplementationReportDisplayJsonXsl.h. What are you doing here to generate it as a constant?
g-maxime commentedon Jun 10, 2026
We just convert the file into a C-style array with this tool
Already done for your PR.
henryborchers commentedon Jun 10, 2026
@g-maxime Thanks.
Looks like something I did broke the build. I'm not exactly sure why though.
henryborchers commentedon Jun 10, 2026
Looks like it wasn't building even before I made my changes....
JeromeMartinez commentedon Jun 11, 2026
I tend to prefer gtest because I already worked with it in the past, but well... The person who does the job is permitted to choose the framework (within limits of complexity and being well known... Catch2 is acceptable).
henryborchers commentedon Jun 15, 2026
Fix in #820 and #818