[FFmpeg-trac] #5748(ffmpeg:new): M3U8 playback broken after seek in Safari OSX/iOS
FFmpeg
trac at avcodec.org
Mon Aug 1 17:31:18 EEST 2016
#5748: M3U8 playback broken after seek in Safari OSX/iOS
-------------------------------------+-------------------------------------
Reporter: bmurphy1976 | Type: defect
Status: new | Priority: normal
Component: ffmpeg | Version:
Keywords: m3u8 | unspecified
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
I recently tried upgrading to ffmpeg 3.1 and a number of videos that
previously worked without issue in Safari on OSX and iOS are now broken
when remuxed into M3U8 format.
The specific behavior is that the video starts playing without any issues
and if you watch from beginning to end there won't be any problem.
However, if at any point you try to seek (sometimes it might take two or
three attempts) the video stream will crash. Playback will either stop
entirely, or the video stream will crash but audio stream will continue
playing.
I ran a git bisect on ffmpeg and this is what I came up with:
{{{
# git bisect log
git bisect start
# good: [c66f4d1ae64dffaf456d05cbdade02054446f499] Changelog: Fix minor
formating inconsistency
git bisect good c66f4d1ae64dffaf456d05cbdade02054446f499
# bad: [18ce5a4d1b3f87b3b45651401cdf3352de34cfa1] configure: use c++98 for
c++ files
git bisect bad 18ce5a4d1b3f87b3b45651401cdf3352de34cfa1
# good: [bb9f7bf1a21d6e00dcb2afaf94d8f84e410cf89c] Changelog/APIChanges
Put 3.0 release marker
git bisect good bb9f7bf1a21d6e00dcb2afaf94d8f84e410cf89c
# good: [bb9f7bf1a21d6e00dcb2afaf94d8f84e410cf89c] Changelog/APIChanges
Put 3.0 release marker
git bisect good bb9f7bf1a21d6e00dcb2afaf94d8f84e410cf89c
# bad: [36dad146935a500ef6fd7246b5c216f7af26f9db] Merge commit
'eaeba6f241e0de0e797be10f8fda967ef8489e64'
git bisect bad 36dad146935a500ef6fd7246b5c216f7af26f9db
# good: [9f6e63f6f2f289e429c9354c80c21a9dbcd21d1a] avfilter/vf_waveform:
add >8 bit support for other filters
git bisect good 9f6e63f6f2f289e429c9354c80c21a9dbcd21d1a
# bad: [0dfbca73bbb3319af49554f7f844e1d7b8d2192c] Merge commit
'dc4983d78af2a666461654067d2e5d45b835358a'
git bisect bad 0dfbca73bbb3319af49554f7f844e1d7b8d2192c
# skip: [e6053b3b19c070e994a501fe0cc20255d15c4aa8] Merge commit
'a8068346e48e123f8d3bdf4d64464d81e53e5fc7'
git bisect skip e6053b3b19c070e994a501fe0cc20255d15c4aa8
# skip: [3fafde6cbe345d2f84cfe61b94d4a823990969b3] lavc: Add seek_preroll
to AVCodecParameters
git bisect skip 3fafde6cbe345d2f84cfe61b94d4a823990969b3
# good: [4d251723c0a157b77fa9d3c84c74507d399f7254] lavfi: Add coreimage
filter for GPU based image filtering on OSX.
git bisect good 4d251723c0a157b77fa9d3c84c74507d399f7254
# good: [cf4d050b7231d7d96ed4d9a1bfaad87b8981e19d] avformat/wavdec: Remove
direct s->pb->buffer access
git bisect good cf4d050b7231d7d96ed4d9a1bfaad87b8981e19d
# good: [38a6242b271fad4917a1c6201ff61e10160c965b] avformat/mpegts: Remove
unused argument from analyze()
git bisect good 38a6242b271fad4917a1c6201ff61e10160c965b
# bad: [030e69b4dcb92f3b0372c9af1cefba60e9135010] Merge commit
'a9e1f2cc61cbd5606a087a60565e87923c39de5a'
git bisect bad 030e69b4dcb92f3b0372c9af1cefba60e9135010
# bad: [bc91bc1d8b2baa29267b5181d805f5286466cade] Merge commit
'0705f5960c9d272cef1309c090000865b991c9c7'
git bisect bad bc91bc1d8b2baa29267b5181d805f5286466cade
# bad: [6f69f7a8bf6a0d013985578df2ef42ee6b1c7994] Merge commit
'9200514ad8717c63f82101dc394f4378854325bf'
git bisect bad 6f69f7a8bf6a0d013985578df2ef42ee6b1c7994
# good: [571aa7d25edc414c3da9253af8b80508c5275b4b] avcodec/shorten: mark
as AV_CODEC_CAP_SUBFRAMES
git bisect good 571aa7d25edc414c3da9253af8b80508c5275b4b
# good: [60b75186b2c878b6257b43c8fcc0b1356ada218e] avcodec/wmalosslessdec:
do not discard last frame
git bisect good 60b75186b2c878b6257b43c8fcc0b1356ada218e
# skip: [9200514ad8717c63f82101dc394f4378854325bf] lavf: replace
AVStream.codec with AVStream.codecpar
git bisect skip 9200514ad8717c63f82101dc394f4378854325bf
# only skipped commits left to test
# possible first bad commit: [6f69f7a8bf6a0d013985578df2ef42ee6b1c7994]
Merge commit '9200514ad8717c63f82101dc394f4378854325bf'
# possible first bad commit: [9200514ad8717c63f82101dc394f4378854325bf]
lavf: replace AVStream.codec with AVStream.codecpar
}}}
It looks like this is the suspect commit:
http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9200514ad8717c63f82101dc394f4378854325bf
I also took a look at the API change log:
{{{
2016-04-14 - afccfaf / b1f01e8 - lavu 55.21.100 / 55.7.0 - hwcontext.h
Add AVHWFramesConstraints and associated API.
2016-04-11 - 6f69f7a / 9200514 - lavf 57.33.100 / 57.5.0 - avformat.h
Add AVStream.codecpar, deprecate AVStream.codec.
2016-04-02 - e8a9b64 - lavu 55.20.100 - base64.h
Add AV_BASE64_DECODE_SIZE(x) macro.
}}}
and can confirm that revision e8a9b64 does not exhibit any problems. The
issue is easily replicated with changeset 6f69f7a/9200514.
I have a sample input video here (Big Buck Bunny):
https://s3.amazonaws.com/1d4326f61a9a4ed596de9e1a41d48413/safariissue/input.mp4
I've already remuxed this video with the two referenced revisions. This
was remuxed with 6f69f7a and exhibits the behavior:
https://s3.amazonaws.com/1d4326f61a9a4ed596de9e1a41d48413/safariissue/6f69f7a/6f69f7a.m3u8
This was remuxed with e8a9b64 and plays back without issue:
https://s3.amazonaws.com/1d4326f61a9a4ed596de9e1a41d48413/safariissue/e8a9b64/e8a9b64.m3u8
The command I used to remux the videos is as follows:
{{{
ffmpeg -y -i input.mp4 -c "copy" -map "0" -f "segment" -segment_time "10"
-vbsf "h264_mp4toannexb" -segment_list_type m3u8 -segment_list
"e8a9b64/e8a9b64.m3u8" "e8a9b64/e8a9b64.m3u8.%05d.ts"
}}}
I can currently reproduce this with Safari Version 9.1.1 (11601.6.17).
--
Ticket URL: <https://trac.ffmpeg.org/ticket/5748>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list