[Ffmpeg-devel] Re: Get 1 frame bitstream without decoding.

Zinetz Victor mail
Thu Oct 27 09:40:49 CEST 2005


hi

  How do I get bitstream (frame by frame) of compressed video without
decoding it?
  I see example as below has frameFinished indicator, to indicate the end of
frame, but
  how do I get the whole 1 frame without decoding (bitstream) or passing the
frameFinished ?

my way (delphi, ffmpeg from csv ~ okt 2005):

  ret_code := av_open_input_file (format_context, pchar (fn), nil, 0, nil);
  ret_code := av_find_stream_info (format_context);

  for i := 0 to format_context^.nb_streams - 1 do
    if format_context^.streams [i]^.codec^.codec_type = CODEC_TYPE_VIDEO
then
    begin
      // search video stream index
      video_stream_idx := i;
      break;
    end;
..
 while av_read_frame (format_context, @i_pkt) = 0 do
 begin
    if i_pkt.stream_index = video_stream_idx then
    begin
    // here i have packed video frame
    end;

    if i_pkt.data <> nil then
      av_free_packet (@i_pkt);
  end;
..
  cleanup();

wbr, Victor





More information about the ffmpeg-devel mailing list