I've got a problem, I have a .srt subtitle file, as external and internal as a subtitle stream, it's easy to load/read the external file but how to read the internal file with .mkv/media?
Extracting the .srt file to a temporary folder is only a temporary solution. (Not implemented yet..)
I want to read the file directly from the subtitle stream, any Ideas how to do that?
I've written my own .srt subtitle filter internally in my media player. Pure C# managed code
To add a little more clarification when you add SoftSubtitles to a media file, then it adds the file to the media as a TextStream and that's what I want to read.
I'm using MediaInfo.dll to read the language of the subtitle streams TextStreams but I can't read the actual subtitles..
To simplify the question even more, what I want is to read the subtitles just like I do with an external .srt file, but reading it from a TextStream is not as easy, because I can see it has a TextStream but can't find it, so can't read the Subtitles.
If Possible do you know any programs that can extract Subtitles in to MemoryStream then return the MemoryStream to my program?? Without removing the TextStream.
Does anyone know how the DirectSubVob or FFDshow load the TextStream from the currently playing media??
Du you know of Library that can extract Subtitles??
I fixed my subtitle problem, with a new custom subfilter, made from reading the source code of SubtitleEdit.
Related
This might not be the best place. I don't have a problem with some code but rather looking for a code idea.
I want to be able to scan a file to a see if the file contains multiple files within, hidden or not.
For example: Take a movie with mp4 extension that movie has a video stream and an audio stream and/or srt file embedded. you can hide a zip file behind a jpeg file using standard cmd command line.
So I want to be able to scan a file for those multiple hidden files/streams inside. Is there such a way and can anyone guide me packages or code snippet or website?
So far I haven't found anything cause I don't know what too google for.
We have a very old file delivery application(IPGear, if you have heard about it, written in tcl). We upload our IP files there and our customers download it from the system.
When you upload a file to this application, it adds .RCA extension to uploaded file and add some metadata to file. if we view the content of any file in a text editor(Usually tgz, pdf and text files), we see some metadata added to the top of the file by the application(5-10 lines, readable).
If you download a file from the system, they somehow strip this metadata from the file and returns as TGZ file which works fine(we can extract it)
if we find that RCA file on the storage where this application keeps files and edit the metadata they have added via text editor, we are able to extract the file without any problem., which fine too. But we need to do this process for 22K files, therefore we need to script it.
We are able to find the bits the application adds by opening via StreamReader, and strip the metadata and write file to the disk via StreamWriter. However, the file we write to the system is corrupted if it is TGZ file. if we do same thing for text files, they work.
the content of the tgz file looks below when we open in text editor
The bits on lines 29-38 are the metadata we strip.
it looks like the streamreader is not able to write this content back to disk even if we tried different encoding settings.
One another note about this is that the file we are trying to read and write is copied from a Solaris based server into local machine(Windows 7) via WinSCP.
So, my question is, what is the best way of reading TGZ file into memory(as text) so manipulation, and save back without corruption? is streamreader and streamwriter not good for this purpose?
I tried to give as much information as I can, please add comments if you need more clarification.
it looks like the streamreader is not able to write this content back to disk even if we tried different encoding settings.
Yes, because a tgz file isn't plain text. StreamReader and StreamWriter are for text content, not arbitrary binary content.
So, my question is, what is the best way of reading TGZ file into memory(as text)
You don't. You read it as binary data, because it is binary data.
If the TGZ archive contains text files, you'll need to decompress the TGZ to the TAR format, then extract the relevant data from that. Then you can work with it as text. Before that point, it's just binary data.
But it sounds like you actually may just want to read text information before the TGZ file... in which case you need to work out where that text information ends, and not read any of the TGZ file as text (because it's not). This is non-trivial, but if you know that the text is in ASCII it'll be a bit easier - you will need to work out how to detect the end of the text and the start of the real content though, and we can't really tell that from the screenshot you've given.
I am developing an application which takes the Back Up of Docx file. For the Initial Back Up I copy the entire file in the destination, but next time I want to perform an incremental Back Up i.e I want to backup only that segment of the Docx file that has undergone changes. I need to find the most efficient to do the same.
I would really be thankful if I get any help in this regard.
The DOCX file is different from the previous Microsoft Word programs, which use the file extension DOC, in the sense that whereas a DOC file uses a text or binary format for storing a document, a DOCX file is based on XML and uses ZIP compression for a smaller file size. In other words, a DOCX file is a set of XML files that have been compressed using ZIP.
It might help if you can use ZipFile to dissect and tell which file is really changed and then incrementally save only the changes in your VCS.
In C#, I'm using both the DotNetZip and the System.Windows.Media
I have a zip file that contains some songs, and I want to play them directly from the zip file without having to extract them ..
Now I manged to get a stream to the sound file:
Stream stream = zip["Songs\\IronMaiden\\Song1.mp3"].OpenReader();
but the problem is, that the MediaPlayer.Open method only takes Uri as a parameter
it doesn't take a stream ..
How Can I get around this ?
Knowing that I can't switch to any other media options like fmod.dll nor anything else.
I'll also said it again, I don't want to extract them.
Any help would be appreciated .. Thanks in advance .. :)
If the media player you want to use does not take a stream, there is no way to do it. As has been mentioned, you'll have to save the file and use a URL to the saved file location. Otherwise, find another media player that works with a stream.
I would like to load an existing XPS document and compress it additionally. Looking into MSDN it seems that .NET allows for setting the compression and interleaving however i was unable to find out how to apply those settings to an existing document.
Here's the simplest answer: XPS is simply a zip.
Manually you can rename your file from something.xps to something.zip, extract the contents, recompress the contents at a higher compression level, rename the file back again - you just need to make sure that the zip tool you are using doesn't end up putting everything within a sub-directory within the zip.
Or you could do with scripting or code.
If you want to reduce the file even more then have a look at my codeproject article.
The code attached to it is built around manipulating the output from the "XPS printer driver", however most of the ideas in it should yield a lot of useful options for you to use to compress a file.