[Ffmpeg-devel] Demuxing still pictures in dvd's II

elupus elupus
Fri Feb 24 14:33:04 CET 2006


> -----Original Message-----
> From: Jan-Willem Mulder [mailto:jwnmulder at gmail.com] 
> Sent: den 18 februari 2006 22:05
> To: FFMpeg development discussions and patches
> Subject: Re: [Ffmpeg-devel] Demuxing still pictures in dvd's II
> you might want to look at ffmpeg.rar in
> 'cvs\XBMC\docs\sources\dvdplayer\ffmpeg' it contains the entire
> modified ffmpeg source code that we use (XMBC) for our 
> dvdplayer. That hack
> suggested in 
> 'http://comments.gmane.org/gmane.comp.video.ffmpeg.devel/24165'
> is still in that source and is working ok for us (although it 
> is not ok for
> a ffmpeg patch I think :) ).  It is the only solution as far 
> as I know.
> The problem is that you cannot detect if a video stream has ended from
> ffmpeg and neither libdvdnav detects such stills. calling
> avcodec_decode_video twice will output the 'incomplete' frame 
> as you already
> have noticed (I believe it is actualy just a flush of the 
> current frame?)
> but it has no use, since you cannot detect the end of a 
> stream. Also, when
> you want to switch to libmpeg2 you have the same problem 
> again. Applying
> that posted hack, you will not need to call 
> avcodec_decode_video. It will
> just work.
> On 2/18/06, Benjamin Larsson <banan at student.ltu.se> wrote:
> >
> > stanley kamithi wrote:
> >
> > >hello,
> > >
> > >i'm adding dvd menu support to the mythtv project and ran into the
> > problem
> > >described in
> > >
> > >
> > >
> > This might be unrelated, but have you looked through the 
> code for xbmc
> > (http://sourceforge.net/projects/xbmc/) ? They made a 
> dvdplayer and uses
> > ffmpeg in certain parts.
> >
> > MvH
> > Benjamin Larsson
> >
> > --
> > "incorrect information" is an oxymoron. Information is, by 
> definition,
> > factual, correct.
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at mplayerhq.hu
> > http://mplayerhq.hu/mailman/listinfo/ffmpeg-devel
> >

Had a look at this again, think I found a solution similar to stanley
kamithi. Had some problems understanding ff_find_start_code, maybe some
documentation on that function is in order, pain to understand what happens
in different cases :).

Anyway attatched is a patch that hopefully should fix this. I've not
verified it in our own dvd player yet, however maybe stanley could in his.
The difference between this one and stanley's is just that it only check the
last state found. I don't think this should cause any problems. So the only
change will be if no startframe is found in the buffer. 

Found some other odity too.. If buffer is empty (eof) no startcode will be
found in the first loop, so frame_start_found will never be set to true.
Means no end will be found either. Is the idea behind the function to first
make sure there is a frame contained in the buffer and then find the end
code? Wouldn't it be better to make sure the caller knows there is a frame
in the buffer and only look for the end (ie start of next frame or
SEQ_END_CODE whatever comes first).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: mpeg12.c.patch
Type: application/octet-stream
Size: 843 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20060224/0e14e14d/attachment.obj>

More information about the ffmpeg-devel mailing list