<div dir="ltr"><div>When I try to open an mpegts stream with av_read_frame on a slow machine, it runs for a few seconds and then quits:<br><br>[mpeg2video @ 0x1b040] mpeg_decode_postinit() failure<br>[mpegts @ 0x16ea0] Estimating duration from bitrate, this may be inaccurate<br>Input #0, mpegts, from '/dev/dvb/adapter0/dvr0':<br>  Duration: N/A, start: 51883.234978, bitrate: 65384 kb/s<br>    Stream #0.0[0x31]: Video: mpeg2video (Main), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 65000 kb/s, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc<br>    Stream #0.1[0x34]: Audio: ac3, 48000 Hz, 5.1, fltp, 384 kb/s<br>14.4971<br>21.4013<br>19.5746<br>17.9103<br>18.5815<br>19.2851<br>18.3992<br>[mpegts @ 0x16ea0] PES packet size mismatch<br>[mpeg2video @ 0x1b040] 00 motion_type at 2 3<br>[mpeg2video @ 0x1b040] Warning MVs not available<br>[mpeg2video @ 0x1b040] concealing 7800 DC, 7800 AC, 7800 MV errors<br><br><br></div><div>The numbers being printed out after the av stream info are approximate frames/sec I calculate every 10 frames.  My code is based on the dranger tutorials like this <a href="http://dranger.com/ffmpeg/tutorial01.c">http://dranger.com/ffmpeg/tutorial01.c</a>  <br><br>On a fast machine this works fine, but on the slower machine it fails like this after a few seconds.  I'm guessing that's because the device file only buffers so much and when av_read_frame doesn't keep up with the hardware, it eventually gets mangled packets and returns < 0.  <br><br>av_read_frame() can run all day long if I don't try and run the CODECs. The trick is how to pick and choose when to run avcodec_decode_video2() which is what consumes CPU.  Is there any way to see when av_read_frame() is getting behind in reading the device file?   Thanks for any suggestions.<br><br></div><div>Elijah<br></div></div>