|
see my very first statement:
native code DLLs need not and can not be registered; they are located using the Windows PATH mechanism, so any folder that is mentioned in the system environment variable "PATH" should be good. The folder holding your EXE itself should also be good.
|
|
|
|
|
I'm learning about the BinaryFormater. If I take a byte[] of length n and serialize it to a FileStream, then open the file as a byte[] with the BinaryReader ReadBytes method, the new byte array is always (n +28) bytes long. There is a 27 byte header that precedes my original byte and 1 final byte is added to the end.
It seems that, for a serialized byte[], the header is always: 0, 1, 0, 0, 0, 255, 255, 255, 255, 1, 0, 0, 0, 0, 0, 0, 0, 15, 1, 0, 0, 0, 169, 37, 0, 0, 2. The final byte is always 11.
I have assumed that the purpose of this header is to indicate the stream's type in subsequent de-serializations and that the final byte is simply a terminator.
Do I have this right?
For a serialized byte[], will the header always be the same sequence within .NET applications?
Is there any logic behind the specific header byte sequence that I am seeing?
|
|
|
|
|
If you are using a default formatter, the deserialization process needs to know what to desearialize it into - which means there's information in there telling it how to deserialize. When you get to large streams, the default binary formatter is an absolute nightmare to work with because it uses reflection on each row of data to work out how to fill the structures back up.
"WPF has many lovers. It's a veritable porn star!" - Josh Smith As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.
My blog | My articles | MoXAML PowerToys | Onyx
|
|
|
|
|
Hi,
I have Live GPS data streaming over a serial port and live video feed on a capture device. Both are related in time. I wish to log (in a text file) incoming GPS data (whether valid or not) synchronized with live video feed recording. And then be able to playback both of them, same thing as in movie subtitles.
Need some help how on:
1 - What pattern to adopt while logging data with the live video recording file in a text file.
2 - Pattern on how to playback the logged data and video file in a synchronized manner.
Least amount of CPU resources are to be used as i intend to run multiple playback simultaneously.
Thank you in advance...
|
|
|
|
|
"To enable a decoder to present synchronized content, such as audio tracks matching the associated video, at least once each 100 ms a Program Clock Reference, or PCR is transmitted in the adaptation field of an MPEG-2 transport stream packet. The PID with the PCR for an MPEG-2 program is identified by the pcr_pid value in the associated Program Map Table. The value of the PCR, when properly used, is employed to generate a system_timing_clock in the decoder. The STC decoder, when properly implemented, provides a highly accurate time base that is used to synchronize audio and video elementary streams. Timing in MPEG2 references this clock, for example the presentation time stamp (PTS) is intended to be relative to the PCR. The first 33 bits are based on a 90 kHz clock. The last 9 are based on a 27 MHz clock. The maximum jitter permitted for the PCR is +/- 500 ns." --Stolen from the wiki on the subject.
If you an read the PCR you should be able to create an overly with your GPS data as a static image with transparencies. I do not know if DirectX supports programmatic access to the PCR information, however.
|
|
|
|
|
hi thankyou for ure deep insight.
but i must define my problems a bit more.
customized gps data coming from a remote data is not to be overlaid on thr video stream rather on maps and several gauges providing also virtual fieldview from above. data is cming around at 3-4hz not at fixed time intervals as its ota. i donot need perfect synchronization just efficent logging and playback techniques to take toll from cpu. as user front end manages multiple live connections each with video feeds maps gauges blah blah and sinultaneously i wish to ablle to playback multiple logged data. so just need some kind of cpu efficent algorithm to playback data and video feed simultaneously or independently and a pattern to log data.
thanks in advance.
|
|
|
|
|
hi ,
Thanks you faheemnadeem, this is the Great topic.
i was searching the information of "mapping with GPS file and Video file using C#.net" from 3 days. currently i am working with sync the GPS data and Video file. give me some more example to sync those file using C#.net , it will be helpfull
Vijaya Raghavendran R
|
|
|
|
|
Hi,
Sorry i am a bit late replying to your question. Anyways there were many ways to implement the syncing of GPS data with a video file. I completed my project sometime ago. In my case i had to implement a very precise synchronization because I had an airborne stabilized articulated camera which has to lock on a certain location and the data was simultaneously play backed with the video and it was very easy to spot sync discrepancies.
Solutions:
1. In real-time while recording one can take the time-stamp from the video when GPS data arrived, store it in a hash-table and while playing it back just search for the closest time stamp from the hash-table matching with current video time after some fixed interval (200ms). This method introduced some time delay as the data display event is to be fired after fixed time interval. (Works well nonetheless).
2. See the basic algorithm to sync subtitle (.srt) files on video. It can be used as well with some modifications.
3. In my case i had to be able to playback recording in a video only, Video + Data and Data only modes with varying playback speeds. No problem for video only mode. For data only mode I used two timers. At start or zero time I read the first NMEA string from the recorded text file. Note: Time stamps are attached with each NMEA string like in .srt file (a unique time not a range). i also read the the second string time and saved a copy of it. Parsed and displayed the first NMEA strings data, took the difference of two time stamps and set the second timer to fire at the next time interval which took the second line and did the same things and sets the first timer as in the previous case. Thus providing synchronization's with minimal delay. Playing it varying speeds is also easy as you have to just divide or multiply the timer value with playback speed. Same procedure follows with video and NMEA data synchronization.
The last case is difficult to implement if you are using a seek bar as well but provides the best synchronization with least processing.
I hope you got some clue to the solution.
Bye...
|
|
|
|
|
hi,
Thanks for your reply i got some idea. currently my recuirement is matching with third point.
I have two Gps file (ground details and player details) and one video file(its contains the game video).I was doing with two timer control, one timer will be keep redraw the 2d graph in form1 and second form contains media player control and its playing the videos.
how can i validate, this is the gps file for the video or this is the videos for the gps file.
Because, i am keeping drawing the 2D graph from gps file using timer1_tick event and video is playing seperatly but its showing as sync formate.
for example,
my system will allow the all the video, if the user is uploading any film(Mummy film) video and click the play button
Then my output will be,
FORM1 it shows the 2d graph from the gps data
FORM2 it plays the Mummy film in the media player control
how i can resolve it
Thanks
Vijay r
Vijaya Raghavendran R
modified on Tuesday, November 16, 2010 1:16 AM
|
|
|
|
|
If i am guessing right then your question was how i can associate multiple GPX files to a video or single GPX files to multiple videos.
The solution is simple.
I was using the name of the files to identify them. e.g i was using a label like this:
<ddmmyy-hhmmss-imei-partno>Both video and gpx files are in the same directory and have the same label for the same job. As the recording for both was started at the same time, so time + date stamp is unique, you can always use a unique ID in front to identify as well. i used the IMEI to identify individual remote clients internally and the part no to identify the number of GPX files or video files associated with each other.
Usually i used a single GPX file to record data as while recording i forced the OS file stream buffer to write the stream to text file immediately once arrived so that data won't be lost or the GPX text file corrupted in case of power loss. Usually you have to make multiple clips of the recorded videos to avoid much data loss incase of power loss. I used to make a new clip after 10 minutes.
I hope i got your question right.
Get back to me if there is anything else you require
Bye.
|
|
|
|
|
Exactly right. but its only from "multiple GPX files to a video".
here
1)Ground details ground1.xml file
2)Player details player1.xml and player2.xml
3)one video file.
I did the master for adding the details of game info and holding the game id for the entire project
Game Name : Test football game
Ground details :Ground1.xml
Adding Player for the game.
Player Name :Vijayr
Player gps data :vijayr.xml
and etc.
Steps i am followed
1)loading the ground in 2D while selecting the game info.
2)having the array with player info based on the game info.
2)Using the timer control i am drawing the player in the ground with using gps player data from the array loop. but it's not
properly sync with video.
As per the above my application is running but its not sync properly with vidoe file.
give me some idea to make it work
Thanks
Vijay r
Vijaya Raghavendran R
|
|
|
|
|
hi!!
m back... this time i thinks its a very basic problem...
i'm trying to copy all the contents of a file(a txt file of 700 lines)
when i write it in another file, it writes 75% of text....
it leaves the rest...
y???
i dont understand...
i'm using stream reader n writer... is it the way to do it..
|
|
|
|
|
ayandelhi wrote: i dont understand...
Without seeing any code I doubt anyone else will either.
Why not just use File.Copy()? (If there was some code it might explain why you cannot use it. )
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
<code>static string file="";
static string line="";
static void Main(string[] args)
{
StreamReader sr=new StreamReader("d:\\file1.txt");
StreamWriter sw=new StreamWriter("D:\\file2.txt");
while((line=sr.Readline())!=null)
{
file="\""+line+"\\r\\n";\\editing the line read from the file
sr.WriteLine(file);
file="";
}
}</code>
file 1 has abt 700 lines and file2 is destination...
|
|
|
|
|
Is the problem that you are missing the <CR><LF> characters from your output file and are you using ReadLine() [^] to read your input file? If so, note that the line end characters <CR> and/or <LF> do not get copied into your input buffer.
It's time for a new signature.
|
|
|
|
|
if you want help with your code, do not tell us anything or show us any code!
The easy ways out:
File.Copy
File.WriteAllBytes(File.ReadAllBytes())
|
|
|
|
|
close your writer when your done, it's probably just not flushing...
sw.close();
also your are calling write line on a stream reader instead of your stream writer...
|
|
|
|
|
sorry.. it was sw.WriteLine()
ok.. so let me see it..
|
|
|
|
|
its working now.. thanks...
thank u very much...
|
|
|
|
|
|
when creating your deployment project,... use the "File Type" Editor to do the association of a file extension to your app, you can configure down to an icon for your files. am not that familiar with WPF, but I can tell you that it does not have to be a console app to pass the args (which will be the file name when you double click on your file type icon). anything that has main entry funtion can be used(i.e windows forms application)
|
|
|
|
|
|
Collin Jasnoch wrote: Does the start app need to be a console app so it can get arguments
FYI: all kinds of apps (Console, WinForm, ...) can get arguments, you pass them interactively on the command line, or in the definition of your Explorer desktop shortcut, or in your Visual Studio debug command line, or in ProcessStartInfo, or...; and your app gets them through the static Main parameters, or Environment.GetCommandLineArgs, or ...
|
|
|
|
|
I have a problem getting the right data from the database.
I have two tables named "Category" and "Items". Under one category, there can be multiple items.
table for category looks like:
catagory_ID | catagory_Name | catagory_Description
and the table for item looks like:
item_ID | cat_ID | item_Name | item_Description
Here category_ID and item_ID are unique keys and cat_ID is the foreign key which is the category_ID.
now i want the query which gives the list of data under typical category in the list format.
e.g if Book is the category Name and book_name1,book_name2,book_name3 are the items under category, it should look like
Book
book_name1
book_name2
book_name3
how to do that? Well i can get something like this:
Book book_name1
Book book_name2
Book book_name3
but I want the category just once in the output..
I am using asp.net with c# and sql server..
code is:
<asp:Repeater runat="server" id="Repeater1">
<HeaderTemplate>Categories<br /></HeaderTemplate>
<ItemTemplate>
<b><%# DataBinder.Eval(Container.DataItem, "category_Name") %></t></b>
<br><%# DataBinder.Eval(Container.DataItem, "item_Name") %></br>
</ItemTemplate>
</asp:Repeater>
suchita
|
|
|
|
|
SayamiSuchi wrote: I want the category just once in the output
Then only put it there once. You control the output.
|
|
|
|