Vitaly Zdanevich
2018-Nov-15 18:15 UTC
[ogg-dev] How to concatenate Ogg in the browser JS?
Yes, I found that serials of my Oggs is all zeros, thank you, I will try to alter serial. 15.11.2018, 19:39, "Ralph Giles" <giles at thaumas.net>:> On 2018-11-15 4:22 a.m., Vitaly Zdanevich wrote: > >> Note: Stream 1 has serial number 0, which is legal but may cause problems with some tools. > > Note if *both* files have the same serial number, it's impossible to > find the points where they were concatentated by bisection, and most > tools will assume they've found all the sections and calculate an > incorrect duration. They can still be played individually because there > is not concatenation boundary to find in the individual case. > > If ogginfo shows the same serial (00000000) for both of your input > streams, that's likely the problem. Muxers are supposed to use a random > serial number to make conflicts unlikely. You can fix them by rewriting > the serial number so there's no conflict. Basically, you change the > serialno field in each ogg page header and then update the crc. > > If you want an example, I have a quick script for doing this in > https://git.xiph.org/?p=rogg.git;a=blob;f=rogg_serial.c > > HTH, > -r
Vitaly Zdanevich
2018-Nov-15 19:01 UTC
[ogg-dev] How to concatenate Ogg in the browser JS?
Maybe you know some existing code snippet or library for Javascript for altering serial and crc? Just now I compiled your quick script to wasm but the size is 28K, I think about simple correct solution for that case. 15.11.2018, 21:15, "Vitaly Zdanevich" <zdanevich.vitaly at ya.ru>:> Yes, I found that serials of my Oggs is all zeros, thank you, I will try to alter serial. > > 15.11.2018, 19:39, "Ralph Giles" <giles at thaumas.net>: >> On 2018-11-15 4:22 a.m., Vitaly Zdanevich wrote: >> >>> Note: Stream 1 has serial number 0, which is legal but may cause problems with some tools. >> >> Note if *both* files have the same serial number, it's impossible to >> find the points where they were concatentated by bisection, and most >> tools will assume they've found all the sections and calculate an >> incorrect duration. They can still be played individually because there >> is not concatenation boundary to find in the individual case. >> >> If ogginfo shows the same serial (00000000) for both of your input >> streams, that's likely the problem. Muxers are supposed to use a random >> serial number to make conflicts unlikely. You can fix them by rewriting >> the serial number so there's no conflict. Basically, you change the >> serialno field in each ogg page header and then update the crc. >> >> If you want an example, I have a quick script for doing this in >> https://git.xiph.org/?p=rogg.git;a=blob;f=rogg_serial.c >> >> HTH, >> -r
On 2018-11-15 11:01 a.m., Vitaly Zdanevich wrote:> Maybe you know some existing code snippet or library for Javascript for altering serial and crc?I don't, sorry.> Just now I compiled your quick script to wasm but the size is 28K, > I think about simple correct solution for that case.If you strip out the fprintf()s for progress and error reporting, it might get smaller. More so if you replace the open/memmap step with direct access to the blob as an array. But it's not very much code to just port the functions to pure js. -r