Segmenting mp4 output files with audio and video

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Segmenting mp4 output files with audio and video

dean

I'm trying to write out a long stream of video into many mp4 files and am wondering
what's the best way to start/stop the segments so each file is a proper mp4 file with
the headers.

The pipeline is roughly rtspsrc -> rtph264depay -> capsfilt -> mp4mux -> filesink
with audio going through rtspsrc -> rtpmp4gdepay -> aacparse -> mp4mux -> filesink

I have the files segmenting on I frames but getting the audio to
match cleanly hasn't been successful yet. It's close but
there is a slight pop in the audio when you put them together into
an editor like premiere. Also at the start of recording, I haven't
been able to get the start of audio to be trimmed and  in sync with start of
the first I frame.

Any recommendations on the best approaches to do something like this?

(I've tried multifile sync but I haven't been able to get properly formatted
mp4 files out and there's still a audio pop between files. Mpeg ts would work
also but IOS doesn't seem to like the ts files produced either)

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Segmenting mp4 output files with audio and video

dean
Would I have to decode and re-encode the audio stream to make it work?

Thanks!