Selective decoding of video packets

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

Selective decoding of video packets

rohitratri@gmail.com
Hi,

I m writing an application which reads mp4 packets from a file (bin1: filesrc->qtdemux->appsink), do some analysis on a set(say 100 - depending on the duration of the video) of packets and choose one single packet and send it for decoding (bin2: appsrc->ffdec_mpeg4->appsink) and then save this image... repeat the process for all packets in the video.
I've a few questions -
1. Are the elements I'm using apt?  and do I've to do some thread management since I've to pipelines?
2. a. I'm able to receive packets from bin1, do some analysis and send a single packet(iFrame) for decoding.. but bin2 doesn't return the packet back(the application hangs!).. 
b. When I turn on the logs with level-4, I do get the packet back!!! - so it could be timing issue, I suspect.
c. The bin1 returns say 200 or so packets and the app receives an EOS message from it! - why is that?
3. Does appsink return packets as and when it receives them or does it wait to preroll?

Please help me understand the situation better. I've hit a roadblock! Please let me know if you need some logs... 

Thanks
Rohit

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Selective decoding of video packets

rohitratri@gmail.com
Come on, guys! Someone's got to know where I'm stuck. 
All you GST gurus out there, please help me out.

Thanks

On Sat, Dec 18, 2010 at 9:12 PM, Rohit Atri <[hidden email]> wrote:
Hi,

I m writing an application which reads mp4 packets from a file (bin1: filesrc->qtdemux->appsink), do some analysis on a set(say 100 - depending on the duration of the video) of packets and choose one single packet and send it for decoding (bin2: appsrc->ffdec_mpeg4->appsink) and then save this image... repeat the process for all packets in the video.
I've a few questions -
1. Are the elements I'm using apt?  and do I've to do some thread management since I've to pipelines?
2. a. I'm able to receive packets from bin1, do some analysis and send a single packet(iFrame) for decoding.. but bin2 doesn't return the packet back(the application hangs!).. 
b. When I turn on the logs with level-4, I do get the packet back!!! - so it could be timing issue, I suspect.
c. The bin1 returns say 200 or so packets and the app receives an EOS message from it! - why is that?
3. Does appsink return packets as and when it receives them or does it wait to preroll?

Please help me understand the situation better. I've hit a roadblock! Please let me know if you need some logs... 

Thanks
Rohit


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Selective decoding of video packets

Timothy Braun
I'm not guru with GST by any means.  But some things you may want to look into below:

On Sun, Dec 19, 2010 at 10:51 AM, Rohit Atri <[hidden email]> wrote:
Come on, guys! Someone's got to know where I'm stuck. 
All you GST gurus out there, please help me out.

Thanks

On Sat, Dec 18, 2010 at 9:12 PM, Rohit Atri <[hidden email]> wrote:
Hi,

I m writing an application which reads mp4 packets from a file (bin1: filesrc->qtdemux->appsink), do some analysis on a set(say 100 - depending on the duration of the video) of packets and choose one single packet and send it for decoding (bin2: appsrc->ffdec_mpeg4->appsink) and then save this image... repeat the process for all packets in the video.
I've a few questions -
1. Are the elements I'm using apt?  and do I've to do some thread management since I've to pipelines?

GST does quite a bit of thread management on it's own.  It builds the logic into the pipeline using various layers of queues and multiqueues.
 
2. a. I'm able to receive packets from bin1, do some analysis and send a single packet(iFrame) for decoding.. but bin2 doesn't return the packet back(the application hangs!).. 

Is it possible that the single packet isn't enough to fulfill the segment?  Take a look at the debug output of ffdec, is it spitting off buffer underflow warnings?
 
b. When I turn on the logs with level-4, I do get the packet back!!! - so it could be timing issue, I suspect.

Not sure where this is coming from, but you may want to throw a queue between your appsrc and ffdec so it would be appsrc->queue->ffdec
 
c. The bin1 returns say 200 or so packets and the app receives an EOS message from it! - why is that?

Not sure where the EOS is coming from, but you may want to look into blocking pads to control pipeline flow.  Also take a look at the 'eos' property on the appsink element, this may be what's causing your issue, but I'm just guessing here.
 
3. Does appsink return packets as and when it receives them or does it wait to preroll?


No idea here, sorry.
 
Please help me understand the situation better. I've hit a roadblock! Please let me know if you need some logs... 

Thanks
Rohit


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Selective decoding of video packets

Stefan Sauer
In reply to this post by rohitratri@gmail.com
Am 18.12.2010 17:42, schrieb Rohit Atri:
> Hi,
>
> I m writing an application which reads mp4 packets from a file (bin1:
> filesrc->qtdemux->appsink), do some analysis on a set(say 100 - depending on the
> duration of the video) of packets and choose one single packet and send it for
> decoding (bin2: appsrc->ffdec_mpeg4->appsink) and then save this image... repeat
> the process for all packets in the video.

The approach sounds a bit flawed. You should send the complete stream to the
decoder. Videodecoding is rarely stateless (mjpeg would be). If you just want
certain frames to be saved in the end. You could e.g. send some custom
synchronized downstream event from teh demuxer side. Then based on the event you
can handled the decoded frames after the decoder.

Stefan

> I've a few questions -
> 1. Are the elements I'm using apt?  and do I've to do some thread management
> since I've to pipelines?
> 2. a. I'm able to receive packets from bin1, do some analysis and send a single
> packet(iFrame) for decoding.. but bin2 doesn't return the packet back(the
> application hangs!)..
> b. When I turn on the logs with level-4, I do get the packet back!!! - so it
> could be timing issue, I suspect.
> c. The bin1 returns say 200 or so packets and the app receives an EOS message
> from it! - why is that?
> 3. Does appsink return packets as and when it receives them or does it wait to
> preroll?
>
> Please help me understand the situation better. I've hit a roadblock! Please let
> me know if you need some logs...
>
> Thanks
> Rohit
>
>
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
>
>
>
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel