question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generating report with mp4 video doesn't allow video to play in served report

See original GitHub issue

Describe the bug Upon generating a report that include a video attached to a test, the served Allure report does not allow the mp4 video to be played

To Reproduce Steps to reproduce the behavior: Attached video with the following code snippet (Python):

        with open(os.path.join(VIDEO_RECORDINGS_DIR, _video_name), "rb") as video_file:
            allure.attach(video_file.read(), name="video", attachment_type=allure.attachment_type.MP4)

Attached generated Allure results dir - mp4 video is included and plays successfully independently and the report recognises that the there is a video attached to a test, but the video cannot be played

Expected behavior Video in report plays as when playing the video independently as a separate file in a media player.

Screenshots image

Environment (please complete the following information):

| Allure version | 2.14.0 | | Test framework | pytest@6.2.4 | | Allure adaptor | allure-pytest@2.9.43 | | Generate report using | allure@2.14.0 |

Additional context Attached generated allure results dir with all artefacts: sample-allure.zip

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
fescobarcommented, Jul 19, 2021

@jsa34 great!

1reaction
jsa34commented, Jul 19, 2021

Interesting - I hadn’t considered the video type…

MP4 doesn’t work, but I swapped out the mp4 to be webm, and all is fine - only code change from Allure’s side is:

        with open(os.path.join(VIDEO_RECORDINGS_DIR, _video_name), "rb") as video_file:
            allure.attach(video_file.read(), name="video", attachment_type=allure.attachment_type.WEBM)

Obviously also rendered the video with vp09 codec (webm) instead of mp4, but no other changes - mp4 and webm videos both were playing fine outside of Allure report, even the video in the results dir

Read more comments on GitHub >

github_iconTop Results From Across the Web

html - HTML5 - How to stream large .mp4 files? - Stack Overflow
Ensure that your web server is reporting the correct Content-Type (video/mp4). Ensure that your web server is configured to serve byte range ...
Read more >
Report inappropriate videos, channels, and other content on ...
Report inappropriate videos, channels, and other content on YouTube. We rely on YouTube community members to report or flag content that they find...
Read more >
The Video Embed element - HTML - MDN Web Docs - Mozilla
The HTML element embeds a media player which supports video playback into the document. You can use for audio content as well, ...
Read more >
Multimedia macro doesn't work properly with mp4 and mov ...
The MP4 file size does appear to play a factor. For example, we didn't notice the problem until I started attaching longer instructional...
Read more >
How to Solve The HTML5 Video 'File Not Found' Error?
An 'HTML5: Video file not found' error indicates either the browser you are using doesn't support HTML5 or the webpage doesn't have the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found