[MPlayer-users] Playing files that are increasing in size

Craig Shelley craig at microtron.org.uk
Fri Oct 10 00:12:16 CEST 2003


Hello all,

This is a kind of feature request.
I was trying to use mencoder to record my tv to a file called 'in'.


mencoder tv:// -tv driver=v4l:input=1:width=768:height=576:norm=PAL -vop
lavcdeint -oac mp3lame -ovc lavc -o in


when I then try to play the file called in (while mencoder is still
going), mplayer will play it, but stop at the point where the original
end of file was.
This can be a little frustrating if you are trying to watch something
you are recording.

I have tried making mencoder write to a fifo, but mplayer seems to get
stuck when reading the data.
I traced the problem back to mencoder, since mplayer plays from fifo ok.

In the end, I made a fifo called 'out', and ran

mplayer out

Then I started mencoder (above), and ran the following program to grab
the data from 'in' and write it into the fifo 'out'

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h> 
#include <unistd.h>
 
main()
{
    int fi, fo;
    ssize_t count;
    char buf[10241];
    fi=open("in",O_RDONLY);
    fo=open("out",O_WRONLY);
     
    while(1)
    {
        count=read(fi,buf,10240);
        write(fo,buf, count);
    }
}

It seems to work a treat, but it would be nice if mplayer could natively
play files that are increasing in size like winamp/xmms
I would imagine it should also be possible to seek within the growing
file too.

Using my bodge of a system, I can pause/unpause the tv and it will
continue where it left off. 


-- 
Craig Shelley <craig at microtron.org.uk>

Homepage: <http://www.microtron.org.uk>



More information about the MPlayer-users mailing list