how to make a files playable...

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

how to make a files playable...

rtstest
Have a pipeline like:

gst-launch v4l2src device=/dev/video0 !
video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! x264enc
key-int-max=4  ! mp4mux ! multifilesink location=test%d.mov
next-file=key-frame


How can i make sure, every file have meta data written and the files are
playable? I tried other encoder like matroska, avi etc. too.

--
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

Tim-Philipp Müller-2
On Mon, 2010-06-28 at 14:38 +0200, [hidden email] wrote:

> gst-launch v4l2src device=/dev/video0 !
> video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! x264enc
> key-int-max=4  ! mp4mux ! multifilesink location=test%d.mov
> next-file=key-frame
>
> How can i make sure, every file have meta data written and the files are
> playable? I tried other encoder like matroska, avi etc. too.

Either pass the --eos-on-shutdown option to gst-launch, or use something
like v4l2src num-buffers=500 to make sure the pipeline shuts down
properly itself after a while.

Cheers
 -Tim


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

Farkas Levente
On 06/28/2010 02:45 PM, Tim-Philipp Müller wrote:

> On Mon, 2010-06-28 at 14:38 +0200, [hidden email] wrote:
>
>> gst-launch v4l2src device=/dev/video0 !
>> video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! x264enc
>> key-int-max=4  ! mp4mux ! multifilesink location=test%d.mov
>> next-file=key-frame
>>
>> How can i make sure, every file have meta data written and the files are
>> playable? I tried other encoder like matroska, avi etc. too.
>
> Either pass the --eos-on-shutdown option to gst-launch, or use something
> like v4l2src num-buffers=500 to make sure the pipeline shuts down
> properly itself after a while.

it'd be useful to document the -e option of gst-launch. this cause a
lot's of question and would help for a lots of people.
just my 2 cent:-)

--
  Levente                               "Si vis pacem para bellum!"

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

Tim-Philipp Müller-2
On Mon, 2010-06-28 at 15:00 +0200, Farkas Levente wrote:

> it'd be useful to document the -e option of gst-launch.

On step ahead of you ;)

http://cgit.freedesktop.org/gstreamer/gstreamer/commit/?id=d989fa3cf1b0a2afb8ab161f8b6f7000fc7ec1db

 Cheers
  -Tim



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

rtstest
In reply to this post by rtstest
> gst-launch v4l2src device=/dev/video0 !
> video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! x264enc
> key-int-max=4  ! mp4mux ! multifilesink location=test%d.mov
> next-file=key-frame
>
> How can i make sure, every file have meta data written and the files are
> playable? I tried other encoder like matroska, avi etc. too.

---------------------------------------------------------------------

Either pass the --eos-on-shutdown option to gst-launch, or use something
like v4l2src num-buffers=500 to make sure the pipeline shuts down
properly itself after a while.

Cheers
 -Tim

---------------------------------------------------------------------

Thanks Tim,

i want to record video from my webcam sequential,  without to stop the pipeline and make every mp4 file playable on the fly.
This sink produce what i want, keframe every 4 sec etc, but not the metadata.
You hint is well for pipeline like:

gst-launch -e --eos-on-shutdown v4l2src device=/dev/video0 num-buffers=5000 !   x264enc key-int-max=4  ! mp4mux  !  filesink location=test.mov
 
changed the multifilesink to filesink. How to configurate multifilesink or the pipeline to handle every file like a full mp4?

I need also ftyp + moov + mdat fragments...

--
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

Stefan Sauer
On 28.06.2010 17:19, [hidden email] wrote:

>> gst-launch v4l2src device=/dev/video0 !
>> video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! x264enc
>> key-int-max=4  ! mp4mux ! multifilesink location=test%d.mov
>> next-file=key-frame
>>
>> How can i make sure, every file have meta data written and the files are
>> playable? I tried other encoder like matroska, avi etc. too.
>>    
> ---------------------------------------------------------------------
>
> Either pass the --eos-on-shutdown option to gst-launch, or use something
> like v4l2src num-buffers=500 to make sure the pipeline shuts down
> properly itself after a while.
>
> Cheers
>  -Tim
>
> ---------------------------------------------------------------------
>
> Thanks Tim,
>
> i want to record video from my webcam sequential,  without to stop the pipeline and make every mp4 file playable on the fly.
> This sink produce what i want, keframe every 4 sec etc, but not the metadata.
> You hint is well for pipeline like:
>
> gst-launch -e --eos-on-shutdown v4l2src device=/dev/video0 num-buffers=5000 !   x264enc key-int-max=4  ! mp4mux  !  filesink location=test.mov
>  
> changed the multifilesink to filesink. How to configurate multifilesink or the pipeline to handle every file like a full mp4?
>
> I need also ftyp + moov + mdat fragments...
>
>  
You need to write an application for that. It could use two muxer !
filesink behind a output-selector. You need to switch the branches
depending on your criteria (e.g. every n-sec and before new keyframe).
You will need to manage the states of the branches (switch the branch
that is inactive to NULL, change the filename and bring it back to PAUSED.

Stefan



------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

rtstest
In reply to this post by rtstest
>> gst-launch v4l2src device=/dev/video0 !
>> video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! x264enc
>> key-int-max=4  ! mp4mux ! multifilesink location=test%d.mov
>> next-file=key-frame
>>
>> How can i make sure, every file have meta data written and the files are
>> playable? I tried other encoder like matroska, avi etc. too.
>>    
> ---------------------------------------------------------------------
>
> Either pass the --eos-on-shutdown option to gst-launch, or use something
> like v4l2src num-buffers=500 to make sure the pipeline shuts down
> properly itself after a while.
>
> Cheers
>  -Tim
>
> ---------------------------------------------------------------------
>
> Thanks Tim,
>
> i want to record video from my webcam sequential,  without to stop the pipeline and make every mp4 file playable on the fly.
> This sink produce what i want, keframe every 4 sec etc, but not the metadata.
> You hint is well for pipeline like:
>
> gst-launch -e --eos-on-shutdown v4l2src device=/dev/video0 num-buffers=5000 !   x264enc key-int-max=4  ! mp4mux  !  filesink location=test.mov
>  
> changed the multifilesink to filesink. How to configurate multifilesink or the pipeline to handle every file like a full mp4?
>
> I need also ftyp + moov + mdat fragments...
>
>  
You need to write an application for that. It could use two muxer !
filesink behind a output-selector. You need to switch the branches
depending on your criteria (e.g. every n-sec and before new keyframe).
You will need to manage the states of the branches (switch the branch
that is inactive to NULL, change the filename and bring it back to PAUSED.

Stefan
_________________________________________________________

Thanks...

Can you provide more details, please?

- How can i determine i-frame or not?
- How it is possible to implement a output-selector and how to deal with data losing, should be a mux set up in spacial state ?
- have i use a tee element to split the steam?

Maybe a way of pseudo code...

Regards,
Kony


--
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

Stefan Sauer
On 05.07.2010 12:47, Konstantin Kauz wrote:

>>> gst-launch v4l2src device=/dev/video0 !
>>> video/x-raw-yuv,width=640,height=480 ! ffmpegcolorspace ! x264enc
>>> key-int-max=4  ! mp4mux ! multifilesink location=test%d.mov
>>> next-file=key-frame
>>>
>>> How can i make sure, every file have meta data written and the files are
>>> playable? I tried other encoder like matroska, avi etc. too.
>>>    
>>>      
>> ---------------------------------------------------------------------
>>
>> Either pass the --eos-on-shutdown option to gst-launch, or use something
>> like v4l2src num-buffers=500 to make sure the pipeline shuts down
>> properly itself after a while.
>>
>> Cheers
>>  -Tim
>>
>> ---------------------------------------------------------------------
>>
>> Thanks Tim,
>>
>> i want to record video from my webcam sequential,  without to stop the pipeline and make every mp4 file playable on the fly.
>> This sink produce what i want, keframe every 4 sec etc, but not the metadata.
>> You hint is well for pipeline like:
>>
>> gst-launch -e --eos-on-shutdown v4l2src device=/dev/video0 num-buffers=5000 !   x264enc key-int-max=4  ! mp4mux  !  filesink location=test.mov
>>  
>> changed the multifilesink to filesink. How to configurate multifilesink or the pipeline to handle every file like a full mp4?
>>
>> I need also ftyp + moov + mdat fragments...
>>
>>  
>>    
> You need to write an application for that. It could use two muxer !
> filesink behind a output-selector. You need to switch the branches
> depending on your criteria (e.g. every n-sec and before new keyframe).
> You will need to manage the states of the branches (switch the branch
> that is inactive to NULL, change the filename and bring it back to PAUSED.
>
> Stefan
> _________________________________________________________
>
> Thanks...
>
> Can you provide more details, please?
>
> - How can i determine i-frame or not?
>  
check the GstBufferFlags (delta-unit)
> - How it is possible to implement a output-selector and how to deal with data losing, should be a mux set up in spacial state ?
> - have i use a tee element to split the steam?
>  
output-selector is like a tee with only one branch active at a time.
> Maybe a way of pseudo code...
>  

I am sorry, I can't write that app for you. You are not the first one
asking for that scheme. Look back in the archives and try to collaborate
with others on that.

Stefan

> Regards,
> Kony
>
>
>  


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

rtstest
In reply to this post by rtstest
I have follow function to change the pad of a output-selector.

(PIPELINE: VIDEOTESTSRC -> TIMEOVERLAY -> x264enc -> output-selector -> mp4mux -> filesink / mp4mux -> filesink )

but files does not have metadata, just the first one, what is wrong?

paused state i tried allready...

static gboolean
switch_cb (gpointer user_data)
{
    GstElement *sel = GST_ELEMENT (user_data);
    GstPad *old_pad, *new_pad = NULL;

    g_object_get (G_OBJECT (sel), "active-pad", &old_pad, NULL);

   char buffer[800];

   sprintf (buffer,file_path_prefix,fr_counter++);


    if (old_pad == osel_src1){
        new_pad = osel_src2;
        gst_element_set_state (mux0, GST_STATE_NULL);
        gst_element_set_state (fsink0, GST_STATE_NULL);
        g_object_set (G_OBJECT (fsink0), "location", &buffer[0], NULL);
        gst_element_set_state (mux0, GST_STATE_PLAYING);
        gst_element_set_state (fsink0, GST_STATE_PLAYING);
    }else{
        new_pad = osel_src1;
        gst_element_set_state (mux1, GST_STATE_NULL);
        gst_element_set_state (fsink1, GST_STATE_NULL);
        g_object_set (G_OBJECT (fsink1), "location", &buffer[0], NULL);
        gst_element_set_state (mux1, GST_STATE_PLAYING);
       gst_element_set_state (fsink1, GST_STATE_PLAYING);
    }
    g_object_set (G_OBJECT (sel), "active-pad", new_pad, NULL);

    g_print ("switched from %s:%s to %s:%s\n", GST_DEBUG_PAD_NAME (old_pad),
             GST_DEBUG_PAD_NAME (new_pad));

    gst_object_unref (old_pad);

    return TRUE;

}

--
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to make a files playable...

Stefan Sauer
On 06.07.2010 13:15, [hidden email] wrote:
> I have follow function to change the pad of a output-selector.
>
> (PIPELINE: VIDEOTESTSRC -> TIMEOVERLAY -> x264enc -> output-selector -> mp4mux -> filesink / mp4mux -> filesink )
>
> but files does not have metadata, just the first one, what is wrong?
>  

This is really a kind of special case. You could add a pad-probe on
output-selector sink-pad and ref the tag-event. Then you can resend it
whenever switching pads. It might be a good idea to actualy add this to
output-selector (add a "resend-tags" property, that is by-.default off.
Could you file a bug for it? Should not be difficult to be added.

Stefan

> paused state i tried allready...
>
> static gboolean
> switch_cb (gpointer user_data)
> {
>     GstElement *sel = GST_ELEMENT (user_data);
>     GstPad *old_pad, *new_pad = NULL;
>
>     g_object_get (G_OBJECT (sel), "active-pad", &old_pad, NULL);
>
>    char buffer[800];
>
>    sprintf (buffer,file_path_prefix,fr_counter++);
>
>
>     if (old_pad == osel_src1){
>         new_pad = osel_src2;
>         gst_element_set_state (mux0, GST_STATE_NULL);
>         gst_element_set_state (fsink0, GST_STATE_NULL);
>         g_object_set (G_OBJECT (fsink0), "location", &buffer[0], NULL);
>         gst_element_set_state (mux0, GST_STATE_PLAYING);
>         gst_element_set_state (fsink0, GST_STATE_PLAYING);
>     }else{
>         new_pad = osel_src1;
>         gst_element_set_state (mux1, GST_STATE_NULL);
>         gst_element_set_state (fsink1, GST_STATE_NULL);
>         g_object_set (G_OBJECT (fsink1), "location", &buffer[0], NULL);
>         gst_element_set_state (mux1, GST_STATE_PLAYING);
>        gst_element_set_state (fsink1, GST_STATE_PLAYING);
>     }
>     g_object_set (G_OBJECT (sel), "active-pad", new_pad, NULL);
>
>     g_print ("switched from %s:%s to %s:%s\n", GST_DEBUG_PAD_NAME (old_pad),
>              GST_DEBUG_PAD_NAME (new_pad));
>
>     gst_object_unref (old_pad);
>
>     return TRUE;
>
> }
>
>  


------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel