Hi all

I am building a live cam which streams h264 over (Flash) RTMP to the 
browser. The RTMP part is set up and I can stream h264 from mp4 files to 
a browser. I also can capture from a connected USB cam and encode the 
stream to h264 (libx264).
The problem is, the frames returned from avcodec_encode_video() look 
different than the frames in the MP4 file.

To record a mp4 file:
  ffmpeg -s qvga -r 25 -f video4linux2 -i /dev/video0 -vcodec libx264 
filename.mp4

Pseudocode for the h264 encoding:
setup in stream
setup out codec
while(av_read_frame(in, frame)) {
  encode(frame, pic)
  swscale(pic)
  encode(pic, buffer)
  // What shall I do with the buffer?
  sendToRtmp(buffer)
}

What I need to known, after a frame is encoded into h264, are there any 
post-decoding before it is written to the mp4-file? I try to analyze the 
code, but I couldn't find it.

Many thanks and kind regards
Beat

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to