Trying to save a real-time video with file save and pause using wxMediaCtrl

Steve it at sca-uk.com
Mon Aug 15 07:05:36 PDT 2011


Hi Guys,
 
I'm about to try to adapt wxMediaCtrl with real-time video (v4l2src) to work
with file save, additionally, when pause resumes, it should resume at the
real-time position, but the file save should include everything including
the frames generated by v4l2src during the pause.  Originally I wanted to
use playbin, because that is what wxMediaCtrl uses, however I feel it is
beyond my pay grade.  
 
This then is my solution.  

The way I propose to pause, is to set the whole pipeline to pause, switch
the source to fakesrc and then resume bin1.  I hope that the frame showing
on xvimagesink will remain as the last frame from v4l2src at the pause point
and that the entire pause-switch-resume process will take less than one
frame to complete.

Switching back is done without pausing.
 
Playing state   
_____________                 
                    .-bin1----------------------------.
                    |                                 |
                .-->|  encodebin1 -> filesink         |
               /    |                                 |   
              /     '---------------------------------'
v4l2src--->tee

              \     .-bin2----------------------------.  
               \    |                                 |  
                .-->|  xvimagesink                    |
                    |                                 |
                    '---------------------------------'
 
fakesrc--->tee
 
Paused state   
____________               
                    .-bin1----------------------------.
                    |                                 |
                .-->|  encodebin1 -> filesink         |
               /    |                                 |   
              /     '---------------------------------'
v4l2src--->tee

                    .-bin2----------------------------.  
                    |                                 |  
                .-->|  xvimagesink                    |
               /    |                                 |
              /     '---------------------------------'
fakesrc--->tee
              
Guys, do you think it is do-able and do you know where I can find any sample
code to help?

Finally, I want to update and release the existing wxMediaCtrl with any
reusable code.

I look forward to your thoughts.

Thanks very much.

Regards

Steve



More information about the gstreamer-devel mailing list