×
INDI Library v1.8.5 Released (19 Apr 2020)

April 2020 release of INDI Library v1.8.5 introduces new drivers while providing fixes and improvements to existing devices and core framework.

Cannot play back SER videos?

1 month 3 weeks ago
knro
Administrator
Administrator
Posts: 7993
Karma: 51
Cannot play back SER videos? #51697
Sorry should have been more clear. For INDI, use set follow-fork-mode child. For KStars, this option must be disabled. Just edit the settings and add # next to it to disable it. Unfortunately, QtCreator does not support per-project GDB settings, so you'd just have to remember to check the setting when you open INDI or KStars in there. Open two qtcreators, one for KStars (with the option disable) and for one INDI (option enabled) and then it should work as expected.

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
The following user(s) said Thank You stefanr

Please Log in or Create an account to join the conversation.

1 month 3 weeks ago
andefeldt
Senior Boarder
Senior Boarder
Posts: 71
More
Cannot play back SER videos? #51818
I can report that I experience the exact same error with videos recorded with my ZWO ASI 294MC Pro camera (and actually also using the CCD Simulator!).
How can I change the SER-file header to see if that helped?

SkyWatcher ED80 Pro
Skywatcher HEQ5 Pro with Rowan Belt Mod with EQDIR cable
ZWO ASI294MC Pro imaging camera
QHY5L-II-C guide camera on 50mm guidescope
DeepSkyDad AF3 autofocuser
Raspberry Pi 4 4GB running Kstars/Ekos

Please Log in or Create an account to join the conversation.

1 month 2 weeks ago 1 month 2 weeks ago by stefanr.
stefanr
Senior Boarder
Senior Boarder
Posts: 41
Karma: 1
More
Cannot play back SER videos? #52049
In my case I was not able to recover the video files by modifying the SER-file header.
My camera has a 12 bit ADC but the INDI camera driver only allows to configure streaming as 8-bit or 16-bit.
Unfortunately, when configured to 16-bit, the output SER-files are corrupted beyond repair with my camera.
But when configured to 8-bit it works fine. (as long as I don't zoom the streaming)

I think we are experiencing an issue similar to what is described here (but that issue is regarding FITS files and another piece of software so it is not exactly the same):
www.astropixelprocessor.com/community/ma...n-16-bit-fits-files/

I am still planning to debug and see if I can figure out exactly where in the code it happens.
But I have not had the time to focus on it yet.

Please Log in or Create an account to join the conversation.

1 month 2 weeks ago 1 month 2 weeks ago by stefanr.
stefanr
Senior Boarder
Senior Boarder
Posts: 41
Karma: 1
More
Cannot play back SER videos? #52051
But if you want to try and see if you can save your files by modifying the SER-file header you can download a hex editor like HxD and edit the SER-file.
I found that information about the resolution of the video is found at Offset = 00000010
column 0A-0B = pixel resolution X = 0050 = 1280
column 0E-0F = pixel resolution Y = C003 = 960

And information about bit depth is found at Offset = 00000020
column 02 = bit depth = 08

And you can use an online tool like www.save-editor.com/tools/wse_hex.html to convert your decimals to HEX.
For example type 960 in the Decimal number field and check "Little Endian" checkbox and click "DEC to HEX" button to see that 960 for example should be written as C003 in the SER-file Header as Hex.

However, as I mentioned I was not able to save my files by adjusting the bit-depth in the header.

Please Log in or Create an account to join the conversation.

1 month 1 week ago
stefanr
Senior Boarder
Senior Boarder
Posts: 41
Karma: 1
More
Cannot play back SER videos? #52700
To sum up I have identified these streaming issues:
1. SER video data is always being dumped as full resolution data by INDI even though subframe/crop is configured in Ekos CCD module. Sub framing does not currently work.
2. SER video data is always being dumped as 8-bit data by INDI which may be "works as designed"(?), but unfortunately the bit depth written to the SER File Header is the bit depth that is configured in the INDI Control panel and not the actual bit depth of the data dumped in the file. This corrupts the files.
3. SER video data is always being dumped as full resolution data by INDI, but the video width and height that is written to the SER File Header is the width and height configured in the INDI Control panel and not the actual width and height configured in the Ekos CCD Module in the "Frame" and "Size" fields. This corrupts the files.

Debugging #1
I did a little bit of debugging today and here is what I found so far regarding issue #1.

When connecting KStars to Indi Server we enter
StreamManager::setSize - Here frame size is set based on the "Resolution" setting in INDI control panel on the "Controls" tab for the camera (for my camera default is 1280 x 960 pixels).

and we also enter
StreamManager::setPixelFormat - Here pixelformat is set based on the "Format" setting in INDI control panel on the "Controls" tab for the camera (for my camera default is Mono 16-bit).

In Kstars -> Ekos CCD Module I updated these values from the default values (default values in these fields before my update were Frame X: 0 Y: 0 and Size W: 1280 H: 960)
I updated the values to:
Frame X: 100 Y: 100
Size W: 640 H: 480

And then I clicked the "Live Video" button and start recording and then we enter
StreamManager::newFrame

From here we enter
StreamManager::asyncStream

And in here
npixels is calculated to be 1228800 and nbytes is 2457600 (as received via NewFrame parameter).
I don't know enough about the math behind this to tell if these numbers are right or wrong.

Then we enter
StreamManager::uploadStream

In here SubX, SubY, SubW and SubH are set to:
SubX=0
SubY=0
SubW=1280
SubH=960


A bit later there is an if expression with this comment:
// Check if we need to subframe

The conditions of the if expression are not met due to the values that was set above (they were set incorrect in my opinion).

However, the image is uploaded to the client (full frame) and control is returned to
StreamManager::asyncStream

Since isRecording() is true, we enter
StreamManager::recordStream

The parameters are:
buffer 2
nbytes 1228800

And we quickly enter
SER_Recorder::writeFrame

where the frame is written and we are done processing this frame.

My Thoughts
It looks like the values filled out in Ekos -> CCD module in the Frame and Size fields never gets passed on to INDI and this is why INDI always dumps full resolution data.
But I have not found out why the SER File Header gets the correct values. Maybe Jasem knows where that part is done?

Anyway, the combination of the right resolution values in the SER File Header (compared to what the user expects) and the "wrong" resolution of the actual SER video data dumped in the file causes the files to be corrupted.

I know too little about INDI and Kstars/Ekos to be able to figure out a good solution. I don't know if it is possible to update the properties used to set the SubX, SubY, SubW and SubH values with the values from the Ekos CCD module when the recording is started or when the live view button is clicked.
But if it is possible I guess it might solve both issue #1 and issue #3.

To solve issue #2 it would be nice to know where in the code the SER File Header is written. If it is "works as designed" that INDI always dumps 8-bit SER Video data in the files, then 8-bit should always be written as bit depth in the SER File Header. That would solve issue #2.

However, I would prefer if it was possible to dump 16-bit and 12-bit SER Video data in the files and have the correct bit-depth in the SER File Header. But the above solution is much better than the way it currently works, so this last part could be a feature request for future version.

Please Log in or Create an account to join the conversation.

1 month 6 days ago
knro
Administrator
Administrator
Posts: 7993
Karma: 51
Cannot play back SER videos? #52888
Thank you for the investigation! So in INDI v1.8.5 I updated the stream manager code a bit so that now it does not downscale from 16 to 8 when recording (only done for the streaming frame). I haven't yet check the cropping/ROI part, I know this works for streaming but have to check for recording as well.

Jasem Mutlaq
Support INDI & Ekos; Get StellarMate Astrophotography Gadget.
How to Submit Logs when you have problems?
Add your observatory info
The following user(s) said Thank You xsnrg, stefanr

Please Log in or Create an account to join the conversation.

4 weeks 1 day ago
stefanr
Senior Boarder
Senior Boarder
Posts: 41
Karma: 1
More
Cannot play back SER videos? #53251
I was out last night after upgrading all software on the StellarMate.
I shot some videos of the moon.

This time i experienced KStars crashing after a very short time with LiveView open when the camera setting was Mono 16-bit (this is a new issue, maybe related to the change knro mentioned above).
After trying a few times with the same result I changed my setting to Mono 8-bit and that still works fine with Live View.

I don't know if I can avoid the crashing if i play around with the USB speed for the camera, but I guess I will give it a try next time.

However, I continued shooting movies of the moon with Mono 8-bit.
If I use the "drag a subframe" functionality on the live view, the SER video files are still corrupted, but that makes sense since you mentioned above that you did not look at it yet.

Full frame recording in Mono 8-bit works fine as it has all the time.
The following user(s) said Thank You knro

Please Log in or Create an account to join the conversation.

Time to create page: 0.490 seconds