Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>In your program, there is a design issue. In the loop <code>while (!sawOutputEOS) {</code> where you are trying to re-encode,</p> <pre><code>int inputBufIndex = encoder.dequeueInputBuffer(kTimeOutUs); </code></pre> <p>Dequeues one buffer from the input / input port of the encoder</p> <pre><code> ByteBuffer dstBuf = encoderInputBuffers[inputBufIndex]; </code></pre> <p>Buffer pointer to the dequeued buffer</p> <pre><code>int sampleSize = extractor.readSampleData(dstBuf, 0 /* offset */); </code></pre> <p>The dequeued buffer is filled with the data from extractor. The output of an extractor is a compressed bitstream. This is <strong>not a YUV</strong> uncompressed frame.</p> <pre><code>encoder.queueInputBuffer(inputBufIndex,....) </code></pre> <p>Here, the compressed bitstream is encoded. Since this is not a YUV frame, the encoder will try to perform a compression to the best of it's ability and hence, you observe a green illegible frame at the output of the encoder. I presume you are observing this on the screen due to the following portion of code where you decode the same content. This would have been observed even if the encoder's output was written into a file and played through a different player or on PC.</p> <p>From the program, I presume your intended design is <code>Decode ==&gt; Encode ==&gt; Live Decode</code> for which your graph should be</p> <pre><code>MediaExtractor ==&gt; MediaCodec (Decoder) ==&gt; MediaCodec (Encoder) ==&gt; MediaCodec (Decoder) ==&gt; Display </code></pre> <p>P.S: Did you observe any memory violations when you run this program? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload