<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Hi all,<div><br></div><div>I want to play MTS(AVCHD) file from my Sony Handy camera in my iOS app, but I only got audio, there is no video decoded. </div><div>the got_picture parameter of function <span style="color: rgb(147, 200, 106); font-family: Helvetica; font-size: 14px;">avcodec_decode_video2 </span><span style="font-size: 12pt;">always return 0. </span></div><div><span style="font-size: 12pt;">my app works OK with other media files like mp4, m3u8.</span></div><div><span style="font-size: 12pt;">generally the play logic in my app is almost same as ffplay application of ffmpeg.</span><span style="font-size: 12pt;">I played the same MTS file with ffplay in Windows, It plays well.</span></div><div><font size="3">I am new to ffmpeg, does anyone </font>knows<font size="3"> the reason that my app can't play MTS file.</font></div><div><br></div><div><div>I used the libraries downloaded from</div><div><a href="https://github.com/kewlbear/FFmpeg-iOS-build-script" target="_blank">https://github.com/kewlbear/FFmpeg-iOS-build-script</a></div></div><div><br></div><div>Here are some logs:</div><div><div><br></div><div>[mpegts @ 0x14f842600] Format mpegts probed with size=2048 and score=100</div><div>[mpegts @ 0x14f842600] stream=0 stream_type=1b pid=1011 prog_reg_desc=HDMV</div><div>[mpegts @ 0x14f842600] stream=1 stream_type=81 pid=1100 prog_reg_desc=HDMV</div><div>[mpegts @ 0x14f842600] stream=2 stream_type=90 pid=1200 prog_reg_desc=HDMV</div><div>[mpegts @ 0x14f842600] Before avformat_find_stream_info() pos: 0 bytes read:32768 seeks:0</div><div>[mpegts @ 0x14f842600] parser not found for codec hdmv_pgs_subtitle, packets or times may be invalid.</div><div>[mpegts @ 0x14f842600] All programs have pmt, headers found</div><div>[mpegts @ 0x14f842600] parser not found for codec hdmv_pgs_subtitle, packets or times may be invalid.</div><div>[mpegts @ 0x14f842600] Non-increasing DTS in stream 2: packet 2 with DTS 87080, packet 3 with DTS 87080</div><div>[mpegts @ 0x14f842600] Non-increasing DTS in stream 2: packet 5 with DTS 132125, packet 6 with DTS 132125</div><div>[mpegts @ 0x14f842600] Non-increasing DTS in stream 2: packet 6 with DTS 132125, packet 7 with DTS 132125</div><div>[mpegts @ 0x14f842600] Non-increasing DTS in stream 2: packet 7 with DTS 132125, packet 8 with DTS 132125</div><div>[mpegts @ 0x14f842600] All info found</div><div>[mpegts @ 0x14f842600] After avformat_find_stream_info() pos: 0 bytes read:1249424 seeks:2 frames:64</div><div>is_realtime entered</div><div>Input #0, mpegts, from 'file:///private/var/mobile/Containers/Bundle/Application/A33114F9-C221-44C2-BCC4-D4FCE03FDCB1/iplayer.app/00264.MTS':</div><div>  Duration: 00:01:41.63, start: 1.033367, bitrate: 17317 kb/s</div><div>  Program 1 </div><div>    Stream #0:0[0x1011], 41, 1/90000: Video: h264 (High) (HDMV / 0x564D4448), yuv420p(left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 1001/60000, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc</div><div>    Stream #0:1[0x1100], 13, 1/90000: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, 5.1(side), fltp, 448 kb/s</div><div>    Stream #0:2[0x1200], 10, 1/90000: Subtitle: hdmv_pgs_subtitle ([144][0][0][0] / 0x0090), 1920x1080</div><div><br></div><div>detected 2 logical cores</div><div>[src @ 0x14f626590] tb:1/48000 samplefmt:fltp samplerate:48000 chlayout:5.1(side)</div><div>[aformat @ 0x14f627c80] Setting 'sample_fmts' to value 'fltp'</div><div>[aformat @ 0x14f627c80] Setting 'sample_rates' to value '44100'</div><div>[aformat @ 0x14f627c80] Setting 'channel_layouts' to value '0x3'</div><div>[aformat @ 0x14f627c80] auto-inserting filter 'auto-inserted resampler 0' between the filter 'src' and the filter 'aformat'</div><div>[AVFilterGraph @ 0x14f50b810] query_formats: 3 queried, 3 merged, 3 already done, 0 delayed</div><div>1.000000 0.000000 0.707107 0.000000 0.707107 0.000000 </div><div>0.000000 1.000000 0.707107 0.000000 0.000000 0.707107 </div><div>[auto-inserted resampler 0 @ 0x14f62b3d0] ch:6 chl:5.1(side) fmt:fltp r:48000Hz -> ch:2 chl:stereo fmt:fltp r:44100Hz</div><div>[h264 @ 0x15001a200] Missing reference picture, default is 65536</div><div>[h264 @ 0x15001a200] Missing reference picture, default is 65536</div><div><br></div><div>Regards,</div><div>Spanfish</div><div><br></div><div><br></div></div>                                    </div></body>
</html>