Message from discussion Any Ideas? Circular Buffers, Writing Packets to File.
Received: by 10.101.128.12 with SMTP id f12mr976888ann.27.1334349647363;
Fri, 13 Apr 2012 13:40:47 -0700 (PDT)
Received: by 10.236.140.10 with SMTP id d10ls1472234yhj.4.gmail; Fri, 13 Apr
2012 13:40:45 -0700 (PDT)
Received: by 10.236.115.169 with SMTP id e29mr404482yhh.16.1334349645902; Fri,
13 Apr 2012 13:40:45 -0700 (PDT)
Authentication-Results: ls.google.com; spf=pass (google.com: domain of
itala...@gmail.com designates internal as permitted sender)
Received: by m16g2000yqc.googlegroups.com with HTTP; Fri, 13 Apr 2012 13:40:45
Date: Fri, 13 Apr 2012 13:40:45 -0700 (PDT)
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:11.0) Gecko/20100101 Firefox/11.0,gzip(gfe)
Subject: Re: Any Ideas? Circular Buffers, Writing Packets to File.
From: Michael <itala...@gmail.com>
To: xuggler-users <email@example.com>
Content-Type: text/plain; charset=ISO-8859-1
Thanks for the input. 30 seconds is too long to buffer in memory for
our purposes. I am leaning toward writing to a random access file
(need multiple read/writes asynchronously). Currently I decode the
packets and retrieve the time stamp for other purposes, I am just
trying to find an efficient way to store the file. At this point in
the project I do not need to have the video file to be readable by a
player, but I need to be able to read through the file and retrieve
individual packets. I suppose this calls for a very custom solution.
On Apr 13, 11:58=A0am, Teddy Yueh <teddyy...@gmail.com> wrote:
> Hi Mike,
> If you need to preserve data based on timestamp, have you considered
> decoding your packets into IVideoPicture and IAudioSamples first? Then yo=
> can grab the timestamp from each of them via getTimestamp(). Once you hav=
> the actual timestamp for a given packet, you can delete the decoded objec=
> to save space and keep the timestamp as a reference point against your
> interval. You can also check the start time of each stream via
> getStartTime() and use that as an offset from the getTimestamp() values.
> That should make it pretty easy to determine whether you have 30 seconds =
> I would imagine that you still want to save the data to file; 30 seconds
> may quite a bit of data to hold in memory.
> On Friday, April 13, 2012 11:10:55 AM UTC-6, Michael wrote:
> > Hi,
> > I am running into some issues getting down to the byte level of video
> > streams. I am trying to write either compressed video/audio to a file,
> > or the packets entirely while retaining functionality to read them. I
> > do not know if xuggler will be qualified to handle this close.
> > It seems that when I get the data from a packet:
> > //IPacket ip
> > byte b =3D new byte[ip.getSize()];
> > ip.get(0, b, 0, ip.getSize());
> > IBuffer ib =3D IBuffer.make(null, b, 0, b.length);
> > IPacket ip2 =3D IPacket.make(ib);
> > The timestamps and other information are not preserved. I found a
> > forum that says the IPacket.get method will only return the payload,
> > and not include the header of the packet.
> > I need to preserve about 30 seconds of video before sending it off.
> > One method would be to write a Circular Buffer or Circular Random
> > Access File sized for the 30 seconds. I would be writing whole
> > packets, and using the IContainer to read from the circular file. As
> > stated above I ran into issues with the packet's header, in addition
> > to reading/writing to a circular random access file with an
> > IContainer. Does anyone think this is feasible?
> > Thanks,