mp4 video length and fragment-duration

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

mp4 video length and fragment-duration

Lambert Veerman



I have a problem understanding the mp4mux in combination with the fragment-duration option.


I have a recorder application, recording live streams to mkv files, starting a new file every hour. For a test this must be changed to mp4. There is a constraint that we want provide streaming access to an open recording, a file not yet finished.


When I take the following pipeline and change the filesrc every hour (sending the h264parse, mp4mux, filesink an eos and changing the location property):


Rtscpsrc- rtphh264depay  - h264parse - mp4mux – filesink


Everything works fine. Also tested using the existing splitmuxsink, same behaviour.


However when I set the fragment-duration option in the mp4mux (to support streaming), my file duration/length meta-data is incorrect. I tried both my existing setup and the splitmuxsink, but the problem is that that file length is set to the stream running time. An example:


Fileof1minute_1.mp4 -> video length is 1 minute

Fileof1minute_2.mp4 -> video length is 2 minutes (the actual video is 1 minute long, however the timeline incorrect)

Fileof1minute_3.mp4 -> video length is 3 minutes (the actual video is 1 minute long, however the timeline incorrect)


As a hack/workaround I can flush the whole pipeline, either by setting the state of the pipeline to ready, or by sending a flush start, flush stop event.


My question is, am I doing something wrong, what is happening here and is there an elegant fix?


Met vriendelijke groet, Sincerely,

Lambert Veerman

[hidden email]

Disclaimer: This e-mail is intended exclusively for the addressee(s), and may not be passed on to, or made available for use by any
person other than the addressee(s). If you have received this email by error then please delete it and notify the sender by return e-mail.
In case of doubt about correctness or completeness of this e-mail, please contact the sender. BigBrother BV dismisses any and every
liability resulting from any electronic transmission.

gstreamer-devel mailing list
[hidden email]