cannot convert svo to avi

Dear community,

I am trying to convert some svo files to avi. I have been trying to do it using the “svo_export.py” file provided in the zed-sdk. It works perfectly on the sample svo files made available by stereolabs. However, I have an error when I try with my own videos.

My videos were collected in 2020 using Zed Mini and can be played on zed player with no error. I think that this is an indication that the files are not corrupted. I tried anyway to repair the svo file using “ZED SVOEditor.exe”. But again, the repaired files cannot be converted to avi.

I explain the steps I follow together with the outputs I receive below. I also attach a sample short video for enabling reproduction.

I use this command in anaconda prompt:

python svo_export.py --mode 0 --input_svo_file output_trawl.svo --output_avi_file output_trawl_avi.avi

After I run the command, it waits for a while and the loading bar suddenly pops as 100% (i.e. without showing the progress at all). After that, an avi file is generated. But it is just an 18kb file with no information at all.

My zed-sdk version: 4.1.1
Link to my sample svo file: output_trawl.svo - Google Drive
Any suggestions are highly appreciated.

Hi @ercan,

Welcome to the Stereolabs forums :slight_smile:

We provide the equivalent sample in C++, would it be possible for you to test it as well? To see if the problem is localized only to the python sample.

Hi @mattrouss
I haven’t used C++ for a while and do not have any required tools (e.g. cmake or visual studio) intalled on my computer right now. I may end up spending many hours just to setup a working environment for C++ on my device.
I already provided a link to a sample video of mine. Would you mind trying it on behalf of me if you have the C++ ready on your computer?
As an extra information, I tried on one of my colleagues computer (with python) but the still having the same problem.

I have verified that the export fails with both python and cpp version of the sample exporter, producing an ~18kb avi file. both work correctly with a zed2i svo captured locally.

According to info from @multicore-manticore, there seems to be two options:
1- My svo file is corrupted in a strange way that it cannot be converted to avi.
I think this option is less likely to be true because it can be played with no problem by stereolab’s player. In addition, some of my existing files were converted into avi soon after it was collected in 2020 by a former colleague.

2- The current verision of zed-sdk cannot perform conversion on the old svo files
I am not sure how come it may be possible… but since some svo files were already converted earlier, I suspect that there is a backward compatibility issue in the zed-sdk versions.

Do you have any suggestions or ideas @mattrouss ?

Have just tested with SDK 3.7.7 with the same results.

as a workaround, you could perhaps play the svo files in zed explorer and do a screen capture of the video from there?

Hi @ercan,

I have taken a look and it appears that the issue is with the SVO itself, as I have tried to open it using the different tools and samples of the ZED SDK and they all return END_OF_SVO_FILE straight after opening it, which is not expected behavior. I will continue looking into why these files appear to be corrupted

Can you please share the version in which the SVO was recorded, as well as the platform? Does this happen on all SVOs you have recorded in 2020?

Also thank you @multicore-manticore for the additional testing, this has helped to troubleshoot.

Hi @mattrouss
I have the same impression that the file is corrupted for some reason. However, there are some evidences refuting this. For example, the file can be played with no problem in the svo player. In addition, all the options of ZED_EVOEditor.exe can be used for the file. It seems like it is only the conversion to avi codes that cannot be used. That is what makes the issue odd.
I checked the file with -inf option of the ZED_EVOEditor.exe, and here is the output:

ZED_SVOEditor.exe -inf output_trawl.svo
-inf option detected
SVO Infos : SVO v 1
Image Size : [ 1280 x 720 ]
Framerate : 60
Number of Frames : 999
ZED Serial Number : 12811826
Compression mode : " H265 Lossy (GPU) compression"
Product : ZED-M
Sensors Fw version : 517
Camera Fw version : 1523

It looks like it is not possible the extract the zed-sdk version from the file itself. Do you know if that is possible?
We think that it was zed-sdk version 3 (but cannot remember the minor version) that was used during recording of the videos.
Now I am planning to check the release dates of the legacy zed-sdk versions and install them one by one to check if it helps. But it may take some time.
I would love to hear if you make any progress on this.

Good idea @multicore-manticore. However, I would like to keep this in my mind as the latest option bercause I need the original data for making detailed analysis.

Hi,

We are still unsure as to why the SVO is corrupted. Thank you for the additional information, I will relay to our tech team to find a way to recover the file.

Hi @mattrouss
Thanks for your help, I will be looking forward to hearing some update from your side.
In the meantime, I tried the conversion process with some older versions of zedsdk-python api.

I successfully set up an environment for zedsdk-python 3.8.2 (cuda 11.7). But the result was the same. Then I wanted to try with older versions. I installed zedsdk-python 3.1.2 (cuda 10.2). I followed the steps given here and run the command python get_python_api.py. This is the output of the command:

(base) C:\Program Files (x86)\ZED SDK>python get_python_api.py
CUDA 10.2
Platform win
ZED 3.2
Python 3.9
Downloading python package from https://download.stereolabs.com/zedsdk/3.2/win/cu102/py39 ...

->Please make sure numpy is installed
python3 -m pip install cython
python3 -m pip install numpy
File saved into pyzed-3.2-cp39-cp39-win_amd64.whl
To install it run :
python3 -m pip install pyzed-3.2-cp39-cp39-win_amd64.whl

Next, I tried to execute the .whl file as suggested at the output just above. But the installation fails at this point and I cannot proceed anymore.

(base) C:\Program Files (x86)\ZED SDK>python -m pip install pyzed-3.2-cp39-cp39-win_amd64.whl
Processing c:\program files (x86)\zed sdk\pyzed-3.2-cp39-cp39-win_amd64.whl
ERROR: Wheel ‘pyzed’ located at C:\Program Files (x86)\ZED SDK\pyzed-3.2-cp39-cp39-win_amd64.whl is invalid.

The problem is still alive and I appreciate any kind of recommendations

Hello @ercan,

Thank you for trying different SDK versions. It seems there is an issue with the installation, can you verify that you are using version 3.1.2? The python logs are suggesting you have installed the ZED SDK 3.2

Thank you @mattrouss for bringing this inconsistency to my attention. It looks like there was a typo in my message or I got confused when trying too many combinations.
I have now tried with a clean start and installation. First, I installed ZED SDK for Windows10 3.1.2 from here. Then followed the instructions on the github page.
The result is the same. I cannot install pyzed-3.1 to my computer. Here is the output:

(base) PS C:\Program Files (x86)\ZED SDK> python get_python_api.py
CUDA 10.2
Platform win
ZED 3.1
Python 3.9
Downloading python package from
https://download.stereolabs.com/zedsdk/3.1/win/cu102/py39 ...

File saved into pyzed-3.1-cp39-cp39-win_amd64.whl
To install it run :
python3 -m pip install pyzed-3.1-cp39-cp39-win_amd64.whl

(base) PS C:\Program Files (x86)\ZED SDK> python -m pip install pyzed-3.1-cp39-cp39-win_amd64.whl
Processing c:\program files (x86)\zed sdk\pyzed-3.1-cp39-cp39-win_amd64.whl
ERROR: Wheel ‘pyzed’ located at C:\Program Files (x86)\ZED SDK\pyzed-3.1-cp39-cp39-win_amd64.whl is invalid.

Could you please check whether you have the same issue? Please not that I am using python for the final installation (not python3). This command already runs python 3.9, which should be fine I guess.

Hi @mattrouss. I am wondering if there is any progress on this issue. I still have the same problem and have no idea on how to solve it.
Thanks

I wanted to try several versions of ZED sdk, but now started receiving another error. I get HTTP Error 308 when I run the command python get_python_api.py. Please see the quote below.
It looks like there is something missing in Stereolab’s side and this is preventing get_python_api.py to download the necessary files. This error was not present when I created the first post. Therefore, I assume that someone on Stereolab’s side is working on it. I would appreciate it if someone could help me proceed.

(base) C:\Program Files (x86)\ZED SDK>python get_python_api.py
CUDA 10.2
Platform win
ZED 3.1
Python 3.9
Downloading python package from https://download.stereolabs.com/zedsdk/3.1/win/cu102/py39
Traceback (most recent call last):
File “C:\Program Files (x86)\ZED SDK\get_python_api.py”, line 141, in
urllib.request.urlretrieve(whl_file_URL, whl_file)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 239, in urlretrieve
with contextlib.closing(urlopen(url, data)) as fp:
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 214, in urlopen
return opener.open(url, data, timeout)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 523, in open
response = meth(req, response)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 632, in http_response
response = self.parent.error(
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 555, in error
result = self._call_chain(*args)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 494, in _call_chain
result = func(*args)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 747, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 523, in open
response = meth(req, response)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 632, in http_response
response = self.parent.error(
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 555, in error
result = self._call_chain(*args)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 494, in _call_chain
result = func(*args)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 747, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 523, in open
response = meth(req, response)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 632, in http_response
response = self.parent.error(
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 561, in error
return self._call_chain(*args)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 494, in _call_chain
result = func(*args)
File “C:\Users\erca\Anaconda3\lib\urllib\request.py”, line 641, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 308: Permanent Redirect