[Ffmpeg-devel] Queing issues in writing a player

Joe Shlobotnick wreuvenspam
Sun Sep 10 19:52:08 CEST 2006


Hello,
   
  I'm trying to write my own player using FFMPEG.
   
  Simplified summary of my design:
   
  Thread1 Loop
  1) Read Packets
  2) Decode Packets
  3) If decoded a video frame put it in the video FIFO with its PTS
  4) If decoded an audio frame put it in the audio FIFO with its PTS
   
  Thread2 Loop
  1) Read Audio & Video samples
  2) Render them as per their PTS
   
  Problem #1:
  FFMPEG does not fill the PTS field on the decoded frames. 
   
  My Solution:
  FFMPEG does fill the PTS field in the packet structure and this should be the same as the frame PTS iff I've just decoded an I-Frame. For other frames, I just add frame duration.
   
  Problem #2:
  According to the PTS values, the PTS of the audio and video can be seperated by more than 500 milli. That means I could end up processing and buffering 500 milli of video before I get to the audio I need. That would mean lots of FIFO memory and the CPU would be working on future video when it should be working on current audio.
   
  Solution ?:
  I'm beginning to think that my 1-PASS design can't work and that I need to process the packets separetely for audio and video. 
   
  Suggestions? 
   
  Thanks,
   
  JS

 		
---------------------------------
 All-new Yahoo! Mail - Fire up a more powerful email and get things done faster.



More information about the ffmpeg-devel mailing list