How to download a mp4/mpeg2 video from orthanc?

283 views
Skip to first unread message

Cristina Barrena

unread,
Jun 29, 2021, 10:54:34 AM6/29/21
to Orthanc Users
Hi!
I'm new and I'm starting with Orthanc few months ago.
I'm using it as a storage server. I upload my videos into the orthanc server and from another app i would like to take them in "real video" (not dicom). I'm using the REST API.
Is this possible?
I'm having a lot of troubles, so I would appreciate a lot your help.
Thank you all,
Best wishes

Sébastien Jodogne

unread,
Jun 30, 2021, 1:39:21 AM6/30/21
to Orthanc Users
Hello,

I have just added a section about downloading videos using the REST API in the Orthanc Book:

Sébastien-

Cristina Barrena

unread,
Jun 30, 2021, 8:45:06 AM6/30/21
to Orthanc Users
Hi Sébastien,
Thank you so much for your support.
I cannot download a mp4 by this way you explain in the documentation. I can only download the first frame of the video.

curl http://localhost:8042/instances/e465dd27-83c96343-96848735-7035a133-1facf1a0/frames/1/raw if I write like that (with a 1 in the number of the frame, it allows me to download the next frame in png) I'm not being able to download a mp4 video directly,

Do you know why I'm having this trouble?

Thank you all,

Cristina

Sébastien Jodogne

unread,
Jun 30, 2021, 9:21:07 AM6/30/21
to Orthanc Users
This most probably means that your DICOM study does *not* embed MP4/MPEG2 file, but is a CINE sequence of individual 2D instances.

In this case, you have to download the individual frames and encode a MP4/MPEG2 from them. This can for instance be done using the "ffmpeg" or "avconv" command-line tools, or using the OpenCV module for Python, as explained on the following page:

The individual JPEG/PNG frames corresponding to the 2D instances can be easily retrieved using the REST API of Orthanc:

Sébastien-
Reply all
Reply to author
Forward
0 new messages