Anime4000 / IFME

Powerful x265 GUI Encoder
https://x265.github.io/
GNU General Public License v2.0
239 stars 53 forks source link

Media info display garbled characters #231

Closed longwu9t closed 5 days ago

longwu9t commented 5 days ago

2024-06-24_130744

The non-ASCII part of the file name is displayed as garbled characters, which does not affect the encoding work, just a small problem.

Anime4000 commented 5 days ago

the ffmpeg probe output JSON, it should be Unicode or at least UTF-8 may I know what is the actual PATH ?

longwu9t commented 5 days ago

d:\vdo\国家地理\阿斯哈图石林\01.mp4

Anime4000 commented 5 days ago

For file path, it could avoid using path from JSON, this should be easy fix.

For issue #230 the Windows Console redirection > not properly parsed to UTF-8, as issue long time ago: https://superuser.com/questions/1584842/ffprobe-output-text-wrong-encoding https://trac.ffmpeg.org/ticket/8890#comment:2

I think, instead of use redirection pipe, output to file instead, so, JSON closing string corrected at least

image

UTF-8 Fix: image image

I think, output to file should be prevent JSON parse error

longwu9t commented 5 days ago

230 causes some MKV files to be unable to open,

if character set detection and conversion is a problem, maybe don't need to read the title of each MKV stream, like processing mp4 files. non-ASCII characters in the mp4 file's title, no error occur.

Anime4000 commented 5 days ago

I understand, my FFmpeg MediaInfo parse doesn't read stream title https://github.com/Anime4000/IFME/blob/master/IFME.FFmpeg/MediaInfo.cs

However the -print_format json -show_format -show_streams will print everything... I wonder if a way to ignore/not to print stream title

longwu9t commented 5 days ago

If need to change the system's regional settings, can consider executing chcp 65001 in the CMD first. i don't know if it is feasible.

longwu9t commented 5 days ago

I tested it again, not all non-ASCII stream titles can cause the error, the following string caused the error: Mandarin Flac 5.1 @ 1718 kbps 带国语解说 cat.zip

Anime4000 commented 5 days ago

For File Path fix

Before: Internet Friendly Media Encoder 8 2 3 ( 'Luminous Horizon' )

After (not using parsed JSON): Internet Friendly Media Encoder 8 2 4 ( 'Eclipsed Radiance' )

Next fix, ignore stream title, so far I import it has no error, this one I need take a look more

longwu9t commented 5 days ago

https://github.com/Anime4000/IFME/assets/9213316/4c25e65d-2759-4943-8015-accf317b9836

This title error is definitely possible on my system, but maybe it's an isolated case?

Anime4000 commented 5 days ago

I instruct Output Redirection to use UTF-8 Encoding, this should print correct text: Internet Friendly Media Encoder 8 2 4 ( 'Eclipsed Radiance' )

Unicode Aware: https://github.com/Anime4000/IFME/blob/master/IFME.FFmpeg/ReadFile.cs#L33

Try this IFME_try8.2.4.zip

longwu9t commented 5 days ago

FFmpeg Media Info ♥ thanks!!!

Anime4000 commented 5 days ago

did it work in your environment ?

longwu9t commented 5 days ago

new version works fine!

Anime4000 commented 5 days ago

Nice! Thank You for reporting this ♥