Git Product home page Git Product logo

Comments (5)

mafintosh avatar mafintosh commented on August 28, 2024

What if you put https://github.com/finnp/to-utf-8 inbetween the input the srt-to-vtt?

var utf8 = require('to-utf-8')
...

source.pipe(utf8).pipe(srtToVtt)

from srt-to-vtt.

grunjol avatar grunjol commented on August 28, 2024

sure, i can do that in my code, but if you want to use srt-to-vtt from CLI this should be done in srt-to-vtt.

But if the module do srt to vtt and srt COULD BE in non-UTF8 and VTT MUST BE in UTF8, IMHO this should be handled by srt-to-vtt.

I can always send PR and get accepted

from srt-to-vtt.

grunjol avatar grunjol commented on August 28, 2024

after some testing i found to-utf-8 doesn't recognize correct encoding because it uses default peek-stream options to get the sample to do the detection. The input is an srt, so the first line is always 1 because its the caption number. So, i need to detect first the encoding from real subtitle text, then pass it to utf8(encoding) to do the conversion

from srt-to-vtt.

grunjol avatar grunjol commented on August 28, 2024

PR finnp/to-utf-8#2 for better encoding detection, if that patch is accepted encoding conversion should be easy as change

return pumpify(split(), parse)
to
return pumpify(utf8({newline:false}), split(), parse)
in
https://github.com/mafintosh/srt-to-vtt/blob/master/index.js#L27

from srt-to-vtt.

mafintosh avatar mafintosh commented on August 28, 2024

send a pr for that change once your pr lands in to-utf-8 :)

from srt-to-vtt.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.