fengalin / media-toc

Build a table of contents from a media file or split a media file into chapters
MIT License
73 stars 3 forks source link

build error under window 10 #155

Open skydig opened 2 years ago

skydig commented 2 years ago

\gettext-rs-0.7.0\src/lib.rs:382: undefined reference to `wbindtextdomain'

it's gettext issue?

zhifu3158 commented 2 years ago

@skydig 大佬,请问您那rust编译器报错汉化翻译是怎么做到的? vs code 错误提示(语句错误。或变量错误等)如何汉化?或者从什么地方进行汉化修改呢??可否告知汉化方法?

fengalin commented 2 years ago

Hi @skydig !

Yes, that would be an issue with gettext-rs. Unfortunately, I can't help much as I don't have any Windows box at hand ATM. Did you install the dependencies as listed in this README? See also the installation instructions I provided for media-toc. Note however that these can be out of date as I didn't test them on Windows in a long time.

Alternatively, I could set the gettext dependency under a feature. Tell me if that would be of any help for you.

zhifu3158 commented 2 years ago

@skydig 大佬,请问您那rust编译器报错汉化翻译是怎么做到的? vs code 错误提示(语句错误。或变量错误等)如何汉化?或者从什么地方进行汉化修改呢??可否告知汉化方法?

### @skydig 大佬,请问您那rust编译器报错汉化翻译是怎么做到的? vs code @@错误提示(语句错误。或变量错误等)如何汉化?或者从什么地方进行汉化修改呢??可否告知汉化方法?

fengalin commented 2 years ago

@skydig: I just pushed 2521d27250d7c07d73acc6449a863c6674cbd0f8, which removes the dependency on gettext-rs by default. You can try it from master. Tell me if it works for you.

Localization support can be compiled back in using --features=gettext.

fengalin commented 2 years ago

@zhifu3158: there is currently no Chinese translation for media-toc. The problem @skydig encountered was due to the localization dependency gettext-rs, which needs special libraries and executables to be installed on the compilation and execution machines. It's always tricky to get this done on Windows, and even more tricky to describe an installation set that would keep working in the long run.

Adding a new localization requires being a bit familiar with gettext and writing a translations file. See this PR from @XTR81 for the Spanish translation. Note however that this was 4 years ago, so the .po file has changed in the meantime. Adding a Chinese translation would require to generate a new .po file first (using this script).

zhifu3158 commented 2 years ago

@zhifu3158:目前没有中文翻译media-toc。@skydig遇到的问题是由于本地化依赖gettext-rs,它需要在编译和执行机器上安装特殊的库和可执行文件。在 Windows 上完成这项工作总是很棘手,而描述一个可以长期工作的安装集则更加棘手。

添加新的本地化需要熟悉gettext并编写翻译文件。有关西班牙语翻译,请参阅@XTR81的此 PR。但请注意,这是 4 年前的事情,因此 .po 文件同时发生了变化。添加中文翻译需要首先生成一个新的 .po 文件(使用此脚本)。

I see. Thank you.. @fengalin

skydig commented 2 years ago

@zhifu3158 我用的中文系统,本人没做什么汉化,如果vs code 错误提示是中文,那应该是vs code做的汉化

skydig commented 2 years ago

@fengalin
I pull master, the compile process can finish and binary is generated. thanks

I want to know any wav files can be analyzed ? I attached a wav file which can not be parsed. I don't know why.

lr.zip

fengalin commented 2 years ago

@skydig: you should be able to open a wave file thanks to the package mingw-w64-x86_64-gst-plugins-good. In a mingw-w64 prompt, you can check if the wave decoder is available using the following command:

gst-inspect-1.0 wavpackdec

This should show the documentation for this GStreamer element.

I tried the file you attached but I suspect it is a bit too short. I can display the waveform in media-toc if I click several times on play. I didn't investigate further, but I think this is due to the fact that the waveform is only rendered when a minimal amount of samples are read. In the file you attached, I think there are not enough samples, but it shouldn't be a problem with a longer file. Tell me if this is a concern for you, I could probably adapt the heuristic a bit to handle this case. However, I guess that if you want to use media-toc to define a table of contents, you probably also want to use a longer file :)

skydig commented 2 years ago

@fengalin you said: I tried the file you attached but I suspect it is a bit too short.

no, it is not short, you can listen it by using normal music player, it is a segment of wav which check left/right sound channel.

fengalin commented 2 years ago

@skydig: I looked again. After unzipping the file you attached, I get a 229kB file named lr.wav. Several third party tools I have at hand account for a 1s and 300ms duration and the waveform is almost flat. One of the tools states that it erroneously reaches end of stream.

In media-toc, I use 5s queues so that the audio waveform can be displayed even when the application is paused, so the file must be longer than 5s for the waveform to display initially.

zhifu3158 commented 2 years ago

@zhifu3158 我用的中文系统,本人没做什么汉化,如果vs code错误提示是中文,那应该是vs code做的汉化

好的 谢谢,我再研究下~~~

skydig commented 2 years ago

@fengalin could you download this music player and try again? https://y.qq.com/download/index.html I see the duration is 24s

fengalin commented 2 years ago

Can you try downloading the file from the link you provided in this comment and check again. I believe it is truncated somehow. Like I said: once I unzipped the file from this link, I get a 229,538 B wave file. Assuming wave codec, not counting the format's overhead, 44,100 samples / s, 2 channels and 2 bytes per samples this is at most 229,538 / 44,100 / 2 / 2 => 1s and 301ms. That's all I can get from this link.

media-toc works OK with wave files provided they can be processed by a regular GStreamer installation. Did you try the command I suggested in this comment?

skydig commented 2 years ago

@fengalin you are right, I attached wrong file.

I attached again, currently, it's OK.

very thanks lr.zip

I attached the command output gst-inspect-1.0 wavpackdec Factory Details: Rank primary (256) Long-name Wavpack audio decoder Klass Codec/Decoder/Audio Description Decodes Wavpack audio data Author Arwed v. Merkatz v.merkatz@gmx.net, Sebastian Dr?ge slomo@circular-chaos.org

Plugin Details: Name wavpack Description Wavpack lossless/lossy audio format handling Filename C:\msys64\mingw64\lib\gstreamer-1.0\libgstwavpack.dll Version 1.18.5 License LGPL Source module gst-plugins-good Source release date 2021-09-08 Binary package GStreamer Good Plug-ins source release Origin URL https://www.msys2.org

GObject +----GInitiallyUnowned +----GstObject +----GstElement +----GstAudioDecoder +----GstWavpackDec

Pad Templates: SINK template: 'sink' Availability: Always Capabilities: audio/x-wavpack depth: [ 1, 32 ] channels: [ 1, 8 ] rate: [ 6000, 192000 ] framed: true

SRC template: 'src' Availability: Always Capabilities: audio/x-raw format: S8 layout: interleaved channels: [ 1, 8 ] rate: [ 6000, 192000 ] audio/x-raw format: S16LE layout: interleaved channels: [ 1, 8 ] rate: [ 6000, 192000 ] audio/x-raw format: S32LE layout: interleaved channels: [ 1, 8 ] rate: [ 6000, 192000 ] audio/x-raw format: F32LE layout: interleaved channels: [ 1, 8 ] rate: [ 6000, 192000 ]

Element has no clocking capabilities. Element has no URI handling capabilities.

Pads: SINK: 'sink' Pad Template: 'sink' SRC: 'src' Pad Template: 'src'

Element Properties: max-errors : Max consecutive decoder errors before returning flow error flags: readable, writable Integer. Range: -1 - 2147483647 Default: 10 min-latency : Aggregate output data to a minimum of latency time (ns) flags: readable, writable Integer64. Range: 0 - 9223372036854775807 Default: 0 name : The name of the object flags: readable, writable, 0x2000 String. Default: "wavpackdec0" parent : The parent of the object flags: readable, writable, 0x2000 Object of type "GstObject" plc : Perform packet loss concealment (if supported) flags: readable, writable Boolean. Default: false tolerance : Perfect ts while timestamp jitter/imperfection within tolerance (ns) flags: readable, writable Integer64. Range: 0 - 9223372036854775807 Default: 0

fengalin commented 2 years ago

Thanks! With your last link, I could unzip the full length file and it opened properly in media-toc. I noticed a regression though: the waveform is not properly refreshed when the window is resized. I created an issue and will look into it later. But the application is still usable on my machine.

The good news from the gst-inspect-1.0 wavpackdec output is that you use a fairly recent version of GStreamer. I was wrong with the element name, it's wavparse that should be used, not wavpackdec, but since they are both part of gst-plugins-good, that shouldn't make any difference.

What are the symptoms of the problem you observe in media-toc? If you still see problems, can you post the output from:

RUST_LOG=INFO GST_DEBUG=*:WARN cargo r -- __PATH_TO_THE_FILE__\\lr.wav

(running in a mingw-w64 prompt under the media-toc source root folder)