Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 28th September 2011, 01:45   #1001  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Sorry, yet another try
http://pastie.org/private/zj0ks6ji33qy4f3xcjyw7w

It seems that a simple "_setmode(_fileno(stdout), _O_U8TEXT)" is sufficient to make 'wcout' output proper UTF-8 to the console (or to a redirected file).

Also, as far as I have tested, this will even handle the SetConsoleOutputCP() stuff for us, making the code even shorter!

Only problem, so far, is that the normal 'cout' will not work anymore. In "release" builds it will trigger a crash, in "debug" builds it will trigger an assertion in some CRT code.

(Not really a problem, I think, because you have those macros for string/text output. However I saw some plain cout's in debug code inside MediaInfoLib)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 28th September 2011 at 01:55.
LoRd_MuldeR is offline   Reply With Quote
Old 28th September 2011, 17:00   #1002  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by LoRd_MuldeR View Post
Only problem, so far, is that the normal 'cout' will not work anymore.
This is weird to have "official" (see source code ) incompatibilities with cout, ah Microsoft... Anyway: I took from your ideas but I actually have made a more global review with input/output bugs from other OS (Linux, Mac) + DLL binding issues, and I updated all packages. Please update all packages from SVN (or there is a all inclusive archive there)
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 29th September 2011, 15:23   #1003  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
I see. You are of course right to use _MSC_VER instead of __WINDOWS__ for the compiler-specific stuff.

However shouldn't the TEXTOUT macro use Ztring().From_ISO_8859_1() instead of Ztring().From_Local() to convert the C-string?

As far as I see, TEXTOUT is mainly used to print some hardcoded strings that look like Latin-1. The user's "local" Codepage, however, might be everything...

(I know that the ASCII characters, code 0 to 127, are identical for most Codepages. But not for all of them: e.g. Windows-932 has no backslash!)
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊

Last edited by LoRd_MuldeR; 29th September 2011 at 15:31.
LoRd_MuldeR is offline   Reply With Quote
Old 29th September 2011, 15:29   #1004  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by LoRd_MuldeR View Post
I see. You are of course right to use _MSC_VER instead of __WINDOWS__ for the compiler-specific stuff.
Yes (try with CodeGear compiler... It does not like it )

Quote:
Originally Posted by LoRd_MuldeR View Post
However shouldn't the TEXTOUT macro use Ztring().From_ISO_8859_1() instead of Ztring().From_Local() to convert the C-string?
This would be same, I use it only for pure US text string. Don't focus of such quick and dirty parts of the code.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 29th September 2011, 15:52   #1005  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Quote:
Originally Posted by Zenitram View Post
This would be same, I use it only for pure US text string. Don't focus of such quick and dirty parts of the code.
Well, if, for example, your "US text string" contains a backslash and the user has configured Windows-932 (Japanese Shift-JIS) as its default Codepage, then we would get a Yen symbol in the Unicode output instead of a backslash symbol after piping the text through a From_Local(), I think.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 30th September 2011, 22:52   #1006  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
Sorry, yet another suggestion

Code:
    //Initialize terminal (to fix Unicode output on Win32)
    #if defined(_MSC_VER) && defined(UNICODE)
        _setmode(_fileno(stdout), _O_U8TEXT);
        _setmode(_fileno(stderr), _O_U8TEXT);
        if(_ftelli64(stdout) == 0I64) fwprintf(stdout, L"\uFEFF");
        if(_ftelli64(stderr) == 0I64) fwprintf(stderr, L"\uFEFF");
    #endif
This will prepend a proper BOM (Byte Order Mark), iff the output is redirected to (an empty) file. Some text editors need this, to recognize the file as UTF-8.
Always writing the BOM is not a good idea, because we might be redirecting to a non-empty file and we don't want the BOM somewhere in the middle of the file.
Also we don't want to write a BOM to the console, as it produces an ugly ▯ character. But this won't happen, because _ftelli64() will return -1 in that case.
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 30th September 2011, 23:17   #1007  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by LoRd_MuldeR View Post
This will prepend a proper BOM (Byte Order Mark)
I prefer not to force it by default (Unicode specs says "Use of a BOM is neither required nor recommended for UTF-8"), I added it as an option.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 30th September 2011, 23:39   #1008  |  Link
LoRd_MuldeR
Software Developer
 
LoRd_MuldeR's Avatar
 
Join Date: Jun 2005
Location: Last House on Slunk Street
Posts: 13,248
__________________
Go to https://standforukraine.com/ to find legitimate Ukrainian Charities 🇺🇦✊
LoRd_MuldeR is offline   Reply With Quote
Old 3rd October 2011, 13:39   #1009  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,197
is there any way to deal with faster recognition of broken files?

when hovering over certain files with cursor or just selecting those with the mouse (e.g. .mkv files gotten from canceling mkvmerge muxing process or eac3to processing), then detecting takes really long and this is really annoying when just accidentally selecting such files or even trying to delete them.
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack)
Thunderbolt8 is offline   Reply With Quote
Old 3rd October 2011, 13:47   #1010  |  Link
Kurtnoise
Swallowed in the Sea
 
Kurtnoise's Avatar
 
Join Date: Oct 2002
Location: Aix-en-Provence, France
Posts: 5,191
Quote:
Originally Posted by Thunderbolt8 View Post
is there any way to deal with faster recognition of broken files?
yes, solution is between your desktop and chair...
Kurtnoise is offline   Reply With Quote
Old 3rd October 2011, 14:45   #1011  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by Thunderbolt8 View Post
is there any way to deal with faster recognition of broken files?
I deal with broken files as for any other files.
Provide some files so I can see the reason your files are long to parse.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 3rd October 2011, 15:57   #1012  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,197
Im not entirely sure if that problem is really due to mediainfo. but on the other hand, I dont know which other progs/tools would parse files in explorer and cause such a system lock.

providing files, doesnt really work that well, because such broken files are quite large (blu-ray sources)
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack)
Thunderbolt8 is offline   Reply With Quote
Old 3rd October 2011, 16:09   #1013  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by Thunderbolt8 View Post
Im not entirely sure if that problem is really due to mediainfo.
Esay to verify: try with MediaInfo GUI (this is the same call to the DLL)

Quote:
Originally Posted by Thunderbolt8 View Post
providing files, doesnt really work that well, because such broken files are quite large (blu-ray sources)
large file from Blu-ray or blu-ray themselfs are not an issue on my side. I can provide a private FTP server for upload if needed. If you don't provide samples, I can not work this issue...
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 3rd October 2011, 22:17   #1014  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,197
does mediainfo also parse blu-ray playlist files? if not, then it might be an issue of lavsplitter or haali
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack)
Thunderbolt8 is offline   Reply With Quote
Old 3rd October 2011, 22:35   #1015  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by Thunderbolt8 View Post
does mediainfo also parse blu-ray playlist files? if not, then it might be an issue of lavsplitter or haali
Yes it does. I also had some feedback on slow parsing of Blu-rays.
I'll check next week (I am not at home this week) my few blu-rays, if I have slow parsing with one, I'll try to fix it, else I'll do nothing until I have files with issues.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 4th October 2011, 16:32   #1016  |  Link
Thunderbolt8
Registered User
 
Join Date: Sep 2006
Posts: 2,197
one example is the south pacific blu-ray (ger, BBC documentary). playlist file 00001.mpls has file 00001.m2ts listed ~240 times after another (according to eac3to), a 1 min 1080p VC-1 file. so the overall playlist length is 4 hours.

this is obviously some garbage list and not really useful for the different episodes in reality. maybe it would be possible to deactivate parsing for such playlist files which have the same .m2ts files listed a certain number of times after another. (5-10 times just to be sure? maybe still too much in case such a file should be larger though) even in case of seamless branching stuff and alike with lots of different parts, usually the same part is not even repeated once directly after another.

parsing should still take rather long in case of real seamless branching movies. but at least we would have gotten rid of parsing rather useless lists. its not really funny not to be able to get out of this parsing loop in explorer other than by task manager.
__________________
Laptop Lenovo Legion 5 17IMH05: i5-10300H, 16 GB Ram, NVIDIA GTX 1650 Ti (+ Intel UHD 630), Windows 10 x64, madVR (x64), MPC-HC (x64), LAV Filter (x64), XySubfilter (x64) (K-lite codec pack)

Last edited by Thunderbolt8; 4th October 2011 at 16:37.
Thunderbolt8 is offline   Reply With Quote
Old 4th October 2011, 18:00   #1017  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by Thunderbolt8 View Post
maybe it would be possible to deactivate parsing for such playlist files which have the same .m2ts files listed a certain number of times after another. (5-10 times just to be sure?
Ouch... MI will definitely hang with such file, because I did not plan such situation, and I parse 200 times the same file (and .m2ts are long to parse du to the structure of the file) and this is totally useless.

I'll try to optimize it, and parse each file only once.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 10th October 2011, 20:24   #1018  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
is there a debian64bit binary?
__________________
certain other member
smok3 is offline   Reply With Quote
Old 10th October 2011, 20:35   #1019  |  Link
Zenitram
Registered User
 
Join Date: Aug 2002
Location: France, Paris
Posts: 672
Quote:
Originally Posted by smok3 View Post
is there a debian64bit binary?
http://mediainfo.sourceforge.net/en/Download/Debian

Note: I checked the links in order to be sure they are OK, I just saw that the 64-bit binaries for CLI and GUI package were missing (.so are OK) and nobody warned me... . Updated.
__________________
Want to know all about your media files? http://mediaarea.net/MediaInfo
Zenitram is offline   Reply With Quote
Old 11th October 2011, 13:37   #1020  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,392
__________________
certain other member
smok3 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 15:16.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.