Regarding multifilesink (creation of multiple files)

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

Regarding multifilesink (creation of multiple files)

Shilpa Chandrappa
This post was updated on .
Hi,

I would like to create a new mp4 file with index incremented when file size has reached to 1GB. Based on some research found multifilesink can be used to perform this. But  I am not able to play the mp4 files created using multifilesink.

Command used

gst-launch-0.10 -e rtspsrc location=rtsp://XYZ name=rtsp  ! queue ! rtph264depay ! video/x-h264, width=1920, height=1080, framerate=30/1  ! mp4mux name=mp4 ! multifilesink location=%ds.mp4 next-file=4 max-file-size=1073741824

Is there any way I can split mp4 files based on max-file size reached ? Need your inputs on how to achieve this.

Regards,
Shilpa Chandrappa
Reply | Threaded
Open this post in threaded view
|

Re: Regarding multifilesink

Sebastian Dröge-3

On Mi, 2014-04-02 at 04:04 -0700, Shilpa Chandrappa wrote:

> Hi,
>
> I would like to create a new mp4 file with index incremented when file size
> has reached to 1GB. Based on some research found multifilesink can be used
> to perform this. But  I am not able to play the mp4 files created using
> multifilesink.
>
> Command used
>
> gst-launch-0.10 -e rtspsrc location=rtsp://XYZ name=rtsp  ! queue !
> rtph264depay ! video/x-h264, width=1920, height=1080, framerate=30/1  !
> mp4mux name=mp4 ! multifilesink location=%ds.mp4 next-file=4
> max-file-size=1073741824
All the MP4 files would be incomplete and not playable standalone if you
do it that way. A MP4 file needs to be finalised after all content is
written, especially every single frame's byte offset needs to be added
to the headers of the file.

> Is there any way I can split mp4 files based on max-file size reached ? Need
> your inputs on how to achieve this.

You'll have to use a pipeline where the MP4 muxer and filesink are
switched dynamically every 1GB, and before destroying the old MP4 muxer
and filesink you would need to send an EOS event to the muxer to
finalise the MP4 file.

To safely relink the pipeline during playback you'll have to use
blocking pad probes on the srcpad upstream of the muxer, and from the
probe callback do the relinking.

--
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (968 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Regarding multifilesink

Shilpa Chandrappa
Thank you. Can this approach be done using gst_parse_launch, as my existing application has been coded using that.

Thanks,
Shilpa Chandrappa
Reply | Threaded
Open this post in threaded view
|

Re: Regarding multifilesink

gagankumarnigam
Hi shilpa,

My requirement is same as yours. Can it be possible for you share your code. Because i am also facing the same problem with multifilesink creating unlimited files with no data. i am using gstreamer-0.10

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Regarding multifilesink

Prabhakar Lad
On Thu, Sep 10, 2015 at 5:24 AM, gagankumarnigam
<[hidden email]> wrote:
> Hi shilpa,
>
> My requirement is same as yours. Can it be possible for you share your code.
> Because i am also facing the same problem with multifilesink creating
> unlimited files with no data. i am using gstreamer-0.10
>
Simplest option would be to update the gstreamer to 1.5.90 and use splitmuxsink.

Cheers,
--Prabhakar Lad
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Regarding multifilesink

gagankumarnigam
thanks prabhakar,
but i am forced to work with version -0.10 bcoz rhel-6.5 by default having the same version of gstreamer.
though i tried to upgrade the gstremer version on rhel-6.5 but it put me on toes without any succes.

Can u plz tell me how to upgrade the gstreamer version on rhel-6.5 (with rpms or tarfiles)

thanks
Reply | Threaded
Open this post in threaded view
|

Re: Regarding multifilesink

gagankumarnigam
In reply to this post by Shilpa Chandrappa
hi,

shilpa  can u help me by sharing your code as my requirement is same as ypurs.