Problem saving video in ADV format

Somewhere to ask questions about the best way to use SharpCap
Forum rules
‍

If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Post Reply
DAS
Posts: 5
Joined: Tue Mar 24, 2026 6:01 am

Problem saving video in ADV format

#1

Post by DAS »

I'm struggling to figure out how to save video files in ADV format. I can specify saving in ADV format under File>SharpCap Settings>Saving>Preferred Video Format, but choosing ADV there seems to have no effect. Once I select my camera, the Capture Format and Area controls is set to SER (when Auto is enabled). When I disable Auto, the drop-down menu doesn't include ADV as an option.

I'm clearly missing something. I didn't see that the the PRO version of SharpCap was needed to save video in ADV format. So I'm perplexed and would be grateful to anyone who could provide some guidance.
User avatar
admin
Site Admin
Posts: 17526
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Problem saving video in ADV format

#2

Post by admin »

Hi,

the ADV file writing in SharpCap only supports images with a single colour plane in them - that means that you can save MONO and RAW images to ADV, but not RGB images. This means you will need to switch your camera into a RAW or MONO mode to get ADV to show up.

In theory, ADV does support RGB images, but only in bit depths of 8 bit, and the version of AdvLib currently used in SharpCap doesn't have support for writing RGB as far as I know. In any case, you would almost certainly want to save to RAW from a colour camera, since RGB modes have data that has already been processed (debayering has happened), so you are not saving the actual data that the camera captured.

cheers,

Robin
DAS
Posts: 5
Joined: Tue Mar 24, 2026 6:01 am

Re: Problem saving video in ADV format

#3

Post by DAS »

Dear Robin,

Thanks for that explanation!

So if my camera/driver only provides color options under "Colour Space," I'm out of luck. I see. I really appreciate that guidance.

Cheers,

Dave
User avatar
admin
Site Admin
Posts: 17526
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Problem saving video in ADV format

#4

Post by admin »

Hi Dave,

what camera are you using? I must admit I was expecting this format to be restricted to use with dedicated astro cameras, mostly ones with inbuilt GPS to take advantage of the richer metadata saved on each frame by ADV, and those all have either RAW or MONO modes.

I don't think that ADV brings any real advantages unless you have that extra metadata to store on a frame-by-frame basis, since the only info you have is the time at which SharpCap receives the frame, and SER files can store that.

cheers,

Robin
DAS
Posts: 5
Joined: Tue Mar 24, 2026 6:01 am

Re: Problem saving video in ADV format

#5

Post by DAS »

Dear Robin,

Apologies for the delay in replying. To answer your question:

I'm trying to use a relatively inexpensive UPS webcam/surveillance camera: https://www.elpcctv.com/2k-starvis-low- ... 2_173.html.

It's a color camera, so as you explained, ADV format isn't possible. Its driver must be such that if I set SharpCap to save in SER or FITS format, the color-space options are limited to MJPG and YUY2. I didn't want to choose MJPG because that would compress each frame. And if I choose YUY2 , the frame rate I can get from this camera goes down considerably.

This is why I'm currently thinking I should record AVI files, which the SharpCap manual says (page 84 of the pdf version) are always saved in an uncompressed format. That, however, presents a challenge to extract the 8-byte timestamps from each frame. I did see your description of how to do that in C# (viewtopic.php?t=370), but my C# skills are limited. So that's going to be a heavy lift for me, I fear.

Can you suggest any other strategies that I should investigate for extracting those 8-byte timestamps from SharpCap's AVI files? My intention is to use a DIY GPS flasher, so I should have good estimate of clock offset on either side of a captured event. But it would be great to have some way to get a list of the timestamps for each frame, so that I could apply a GPS-flasher-based correction to the actual SharpCap timestamps, rather than having to assume a constant frame rate.

Please, if I'm missing something and am going about this the wrong way, I'd be very happy to be put straight.

Cheers,

Dave
DAS
Posts: 5
Joined: Tue Mar 24, 2026 6:01 am

Re: Problem saving video in ADV format

#6

Post by DAS »

* Correction to my last posting: "UPS" --> "USB"
User avatar
admin
Site Admin
Posts: 17526
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Problem saving video in ADV format

#7

Post by admin »

Hi Dave,

when you are using a webcam, the options for colour space like MJPG and YUV2 have nothing to do with the way the data is saved to AVI file - they relate to the way that the camera sends the image data over USB to the computer. Modern versions of SharpCap (since about version 3.0 or so) always save uncompressed RGB to AVI files. So, if you choose MJPG, it's the camera doing the compression to send the data over USB, then it gets decompressed in software inside SharpCap and saved to RGB (or SER, or whatever). This is also the reason that you see a higher frame rate with MJPG - the compression allows each frame to be sent over USB using less data, so you can get more frames per second.

I still think the best bet for you is SER format, which is much simpler than AVI and has timestamps embedded at the end of the file in a format that is relatively easy to read from C#. The documentation is here - https://free-astro.org/images/5/51/SER_Doc_V3b.pdf

The code needed to read the timestamps from SER (once you have located them at the end of the file) is roughly

Code: Select all

		// for each entry read the data as a 64 bit integer (long), then convert to a DateTime
                    var ticks = reader.ReadInt64();
                    var time = new DateTime(ticks, DateTimeKind.Utc);
Hope this helps,

Robin
DAS
Posts: 5
Joined: Tue Mar 24, 2026 6:01 am

Re: Problem saving video in ADV format

#8

Post by DAS »

Dear Robin,

That does indeed help.

I'll probably take your advice then and set the color space to YUY2 to avoid having the camera compress the images and in any case save them in SER format so that the timestamps SharpCap adds can be read by the software employed in processing these captures downstream.

Thanks very much for taking the time to explain things to me.

Cheers,

Dave
Post Reply