Giter Site home page Giter Site logo

Comments (7)

yapingcat avatar yapingcat commented on June 11, 2024

sorry. i can't get the point of ’multiple calls‘, In which scenario, writeMoov is called multiple times?

from gomedia.

iMro0t avatar iMro0t commented on June 11, 2024

in my case i was writing init segment with Movmuxer.WriteInitSegment function in different file and then Movmuxer.Write is internally calling Movmuxer.writeMoov

from gomedia.

yapingcat avatar yapingcat commented on June 11, 2024

in your case ,fmp4 is used for hls ? and do you create mov muxer with MP4_FLAG_FRAGMENT ?

if you use MP4_FLAG_FRAGMENT , you should not call the WriteInitSegment function, mp4 library write moov box Automatically

from gomedia.

iMro0t avatar iMro0t commented on June 11, 2024

in your case ,fmp4 is used for hls ?

Yes

do you create mov muxer with MP4_FLAG_FRAGMENT ?

Yes

mp4 library write moov box Automatically

it writes moov box but its only writing in first segment. maybe in this case OnFragment callback will be helpful so on first OnFragment callback we can save it to init fragment and rest is for fmp4

from gomedia.

yapingcat avatar yapingcat commented on June 11, 2024

you should use MP4_FLAG_DASH flag for hls. refer to hls fmp4
for hls,the best way is to save moov box in EXT-X-MAP, write moov into every segment is unnecessary

from gomedia.

iMro0t avatar iMro0t commented on June 11, 2024

if i == 0 {
initFile, _ := os.OpenFile("init.mp4", os.O_CREATE|os.O_RDWR, 0666)
muxer.WriteInitSegment(initFile)
initFile.Close()
hls.initUri = "init.mp4"
}

the example code also calls muxer.WriteInitSegment which may lead to this error too

from gomedia.

yapingcat avatar yapingcat commented on June 11, 2024

muxer, err = mp4.CreateMp4Muxer(mp4file, mp4.WithMp4Flag(mp4.MP4_FLAG_DASH))

if mp4 muxer is created with MP4_FLAG_DASH , the writeMoov function will not been called in mp4 library.

so writeMoov is only called when you call WriteInitSegment,it won't trigger multiple calls

from gomedia.

Related Issues (20)

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.