Examples: Using random access capabilities

The following examples show how to use random access capabilities:

Creating sync points when building a 3GP file

The following example shows how to create sync points for a 3GP file. A sync point will be added for every video sync frame (I-frame).

Command

3gpapp –y –c newsample.3gp sample.namr sample.n263

Returned data

3gpapp - NMS Communications 2007 - v1.0.725
Write sync points
CREATING newsample.3gp FROM sample.namr AND sample.n263
Reading data from file: sample.namr
BufferSize=91117, total read 91117 bytes
91117 bytes read in file: sample.namr
67808 bytes written in from file sample.namr to file: newsample.3gp
67808 bytes written in from file sample.namr to file: newsample.3gp
Reading data from file: sample.n263
BufferSize=234549, total read 234549 bytes
234549 bytes read in file: sample.n263
231429 bytes written in from file sample.n263 to file: newsample.3gp
231429 bytes written in from file sample.n263 to file: newsample.3gp

Printing a sync point table for a 3GP file

The following example shows how to print a sync point table for a 3GP file.

Command

3gpapp –i newsample.3gp (or use –d option)

Returned data

3gpapp - NMS Communications 2007 - v1.0.725
GETTING FILE INFO FROM newsample.3gp
       Descriptor:
         file type                    = 1 (3GP)
         format                       = 3GP6
         version                      = 256 (v6.1.0)
       Stream 0:
         stream type                  = 1 (AUDIO)
         stream id                    = 1
         stream codec                 = 1 (AMR)
         duration                     = 42380 ms
         stream data size             = 67808 bytes
         stream data rate             = 12.80 kbits/second
         sample avg rate              = 50.00 frames/second
       Stream 1:
         stream type                  = 2 (VIDEO)
         stream id                    = 2
         stream codec                 = 3 (H263)
         duration                     = 42417 ms
         stream data size             = 231429 bytes
         stream data rate             = 43.65 kbits/second
         sample avg rate              = 5.21 frames/second
       Sync table information:
         Sync table size = 10
         Sync      Sync
         Point     Time(ms)
         ------------------
             0            0
             1         5000
             2        10000
             3        15041
             4        20041
             5        22208
             6        27208
             7        32375
             8        37416
             9        40750

Seeking to a specific time in a 3GP file

The following example shows how to seek to a time in a 3GP file. This example seeks to the time T = 20 seconds (20000 ms). A seek operation can be done once and only once, at the start of the file.

Command

3gpapp –Y20000 newsample.3gp

Returned data

3gpapp - NMS Communications 2007 - v1.0.725
Seeking ahead n=20000 msecs.
EXTRACT from newsample.3gp INTO newsample.xxx FOR AUDIO AND VIDEO
48031 bytes copied to file: newsample.namr
Total: 1358523 bytes copied to file: newsample.namr
121450 bytes copied to file: newsample.n263
Total: 121450 bytes copied to file: newsample.n263