2021-05-13 23:48:51 +00:00
---
title: Media Reporting
---
The [media_reporting.py ](https://github.com/allegroai/clearml/blob/master/examples/reporting/media_reporting.py ) example
demonstrates reporting (uploading) images, audio, and video. Use the [Logger.report_media ](../../references/sdk/logger.md#report_media )
method to upload from:
* Local path
* BytesIO stream
* URL of media already uploaded to some storage
2022-03-13 13:07:06 +00:00
ClearML uploads media to the bucket specified in the ClearML configuration file or ClearML can be configured for image storage, see [Logger.set_default_upload_destination ](../../references/sdk/logger.md#set_default_upload_destination )
2022-05-18 08:49:31 +00:00
(storage for [artifacts ](../../clearml_sdk/task_sdk.md#setting-upload-destination ) is different). Set credentials for storage in the ClearML
2021-05-13 23:48:51 +00:00
[configuration file ](../../configs/clearml_conf.md ).
2022-05-22 07:27:30 +00:00
ClearML reports media in the **ClearML Web UI** ** >** experiment details ** >** **DEBUG SAMPLES**
tab.
2021-05-13 23:48:51 +00:00
2023-09-04 12:40:42 +00:00
When the script runs, it creates an experiment named `audio and video reporting` in the `examples`
2021-05-13 23:48:51 +00:00
project.
2021-09-09 10:17:46 +00:00
## Reporting (Uploading) Media from a Source by URL
2021-05-13 23:48:51 +00:00
Report by calling the [Logger.report_media ](../../references/sdk/logger.md#report_media )
method using the `url` parameter.
2021-12-14 13:12:30 +00:00
```python
# report video, an already uploaded video media (url)
Logger.current_logger().report_media(
'video', 'big bunny', iteration=1,
url='https://test-videos.co.uk/vids/bigbuckbunny/mp4/h264/720/Big_Buck_Bunny_720_10s_1MB.mp4'
)
2021-05-13 23:48:51 +00:00
2021-12-14 13:12:30 +00:00
# report audio, report an already uploaded audio media (url)
Logger.current_logger().report_media(
'audio', 'pink panther', iteration=1,
url='https://www2.cs.uic.edu/~i101/SoundFiles/PinkPanther30.wav'
)
```
2021-05-13 23:48:51 +00:00
2022-12-27 14:01:47 +00:00
The reported audio can be viewed in the **DEBUG SAMPLES** tab. Double-click a thumbnail, and the audio player opens.
2021-05-13 23:48:51 +00:00
![image ](../../img/examples_reporting_08.png )
2021-09-09 10:17:46 +00:00
## Reporting (Uploading) Media from a Local File
2021-05-13 23:48:51 +00:00
Use the `local_path` parameter.
2021-12-14 13:12:30 +00:00
```python
# report audio, report local media audio file
Logger.current_logger().report_media(
'audio', 'tada', iteration=1,
local_path=os.path.join('data_samples', 'sample.mp3')
)
```
2021-05-13 23:48:51 +00:00
2022-12-27 14:01:47 +00:00
The reported video can be viewed in the **DEBUG SAMPLES** tab. Double-click a thumbnail, and the video player opens.
2021-05-13 23:48:51 +00:00
![image ](../../img/examples_reporting_09.png )