allure2 icon indicating copy to clipboard operation
allure2 copied to clipboard

Video is being attached but dosen't allow to play the video after serving the allure report.

Open nitheeshareddy opened this issue 3 years ago • 1 comments

Describe the bug

When the allure report is served, the video is attached in the MP4 format but doesn’t allow to play it.

Python Code used to attach the video

with open( f"{file_path}/video.mp4", "rb" ) as file: allure.attach( file.read(), name="Test Exectution Video", attachment_type=allure.attachment_type.MP4 ) Also tried with the below code: allure.attach.file( f"{file_path}}/video.mp4", "Test Exectution Video", allure.attachment_type.MP4, )

Note: Tested with webm attachment_type as well but it resulted in the same issue.

Steps to reproduce the behavior:

  1. Generate the allure report.
  2. Observe that the video is attached but it doesn’t allow to play.

Expected behavior

User should be able to play the attached video

Attachments

image

Environment : | Allure version | 2.19.0 | | Test framework | [email protected] | | Allure adaptor | [email protected] | | Generate report using | [email protected] |

nitheeshareddy avatar Sep 13 '22 16:09 nitheeshareddy

Use avc1 encoding to generate a video file. eg: self.running = True fourcc = cv2.VideoWriter_fourcc(*'avc1') screen_size = pyautogui.size() out = cv2.VideoWriter(self.output_file, fourcc, self.fps, screen_size) start_time = time.time() while self.running: img = pyautogui.screenshot() frame = np.array(img) frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR) out.write(frame) if time.time() - start_time > self.duration: break out.release() cv2.destroyAllWindows()

ll-shiyi avatar Aug 21 '24 08:08 ll-shiyi

see https://github.com/orgs/allure-framework/discussions/2828

baev avatar Jan 09 '25 15:01 baev