How come I can log into the TcpVideoViewer sample and it retrieves a list of cameras to populate the drop-down, but no video is ever shown?

The exception I see is:

System.Windows.Data Error: 23 : Cannot convert ‘’ from type ‘’ to type ‘System.Windows.Media.ImageSource’ for ‘en-US’ culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: ImageSourceConverter cannot convert from (null).

at System.ComponentModel.TypeConverter.GetConvertFromException(Object value)

at System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)

at MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)’

There are no line numbers so I don’t know where in the sample it comes from though!

Does the same camera work when you view in Smart Client?

Sorry, maybe I should have replied here so you got alerted - hopefully you’ll see my response below now!

Yes. There are a couple of cameras that don’t work in Smart Client for some reason but the others do - but none of them works in the TcpVideoViewer sample.

Can you check if the user that you are using is allowed to see video? Please add it to the administrator’s role in Management Client.

I’ve tried with a basic user and a Windows (NTLM) user, both of which are listed under the Administrators role (I just double checked!).

Could you put breakpoints in all places where NotifyPropertyChanged(“VideoImage”); has been called and check the value for VideoImage? The most interesting place would be these two methods: OnLiveImageReceivedMethod and OnPlaybackImageReceivedMethod and follow the stack trace to find out what causing the issue.

Thanks for the tip - yes, I will try that and report back.

Well this is rather odd… I put breakpoints on each of the three NotifyPropertyChanged(“VideoImage”); instances, but only the first ever seems to occur. And that one is immediately after

VidoeImage is set to null…! The two in OnLiveImageReceivedMethod and OnPlaybackImageReceivedMethod never happen.

It seems neither Live nor Playback video received. But, you can get rid of the error message by adding TargetNullValue={x:Null} attribute to image control called named “_videoCanvas” in XAML file and the source should look like Source=“{Binding VideoImage, TargetNullValue={x:Null}}”. And, try to select the camera which is working.

Thanks, that does get rid of the error. I’ve just found a working camera via Smart Client and viewed that in the sample app, but the result is exactly the same (albeit without the error!), which is that it says “Live” and mentions a token under the Milestone logo, then says e.g. “Stopped at 12:55:48” almost immediately.

Could you please record some videos on a camera and see if you can playback from the sample. Just wondering when “Stopped at 12:55:48” is shown after clicking the “Stop” or “Live” button (actually the button text switches between “Live” and “Stop”)?

“Could you please record some videos on a camera and see if you can playback from the sample.”

Do you mean I need to somehow upload some recorded video to Milestone and try accessing that? Or do you mean try watching video that was recorded by one of the existing cameras? Looking at Smart Client, there’s plenty of recorded video, but none shows up in the sample: beneath “Playback”, it just says “No response”. Symptomatic of the same issue, do you think…?

Aha! I’ve got it!

The Milestone server is configured to use its internal name for the “Local web server address”. Even though I’m accessing the server using its IP address from the sample code, when it gets a list of cameras back, the URLs in the list use the internal name not the IP address. And since the sample code is running elsewhere, it had no mapping from the name to the IP address, which is why everything failed. As soon as I added the mapping into [C:\Windows\System32\drivers\etc\hosts](file:C:/Windows/System32/drivers/etc/hosts) it all sprung to life!

Thanks for the help - the debugging and breakpoint advice definitely helped me work out what was going on!