{"action":"created","issue":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/2823","repository_url":"https://api.github.com/repos/mpv-player/mpv","labels_url":"https://api.github.com/repos/mpv-player/mpv/issues/2823/labels{/name}","comments_url":"https://api.github.com/repos/mpv-player/mpv/issues/2823/comments","events_url":"https://api.github.com/repos/mpv-player/mpv/issues/2823/events","html_url":"https://github.com/mpv-player/mpv/issues/2823","id":133588124,"number":2823,"title":"gapless playback doesn't work with opus","user":{"login":"calestyo","id":919933,"avatar_url":"https://avatars.githubusercontent.com/u/919933?v=3","gravatar_id":"","url":"https://api.github.com/users/calestyo","html_url":"https://github.com/calestyo","followers_url":"https://api.github.com/users/calestyo/followers","following_url":"https://api.github.com/users/calestyo/following{/other_user}","gists_url":"https://api.github.com/users/calestyo/gists{/gist_id}","starred_url":"https://api.github.com/users/calestyo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calestyo/subscriptions","organizations_url":"https://api.github.com/users/calestyo/orgs","repos_url":"https://api.github.com/users/calestyo/repos","events_url":"https://api.github.com/users/calestyo/events{/privacy}","received_events_url":"https://api.github.com/users/calestyo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mpv-player/mpv/labels/ffmpeg-bug","name":"ffmpeg-bug","color":"444444"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2016-02-14T22:35:08Z","updated_at":"2016-02-19T19:06:11Z","closed_at":null,"body":"Hey.\r\n\r\nYet another gapless playback issue... it doesn't work with opus files either :-(\r\n\r\nThe approach is basically: take and two tracks that play gapless (or take a single track and split it at a position with audio into two WAVs), encode them with opusenc, play it back with mpv... and one will hear a really very tiny gap (which sounds therefore more like a click) between the two.\r\n\r\nEncoding settings I've used were: opusenc --bitrate 128 --vbr in.wav out.opus.\r\nFurther, I decoded the opus files again with opusdec, opened the 6 files in audactiy (which AFAICS also uses ffmpeg to import Opus, just as mpv) and concatenated the corresponding files:\r\n\r\n1st track: original WAV\r\n2nd track: ffmpeg imported Opus\r\n3rd track: WAV, gained by decoding the Opus files with opusdec\r\n\r\nThe beginning looks like:\r\n![screenshot from 2016-02-14 23-26-40](https://cloud.githubusercontent.com/assets/919933/13036855/35250824-d373-11e5-8470-82c65bb4e359.png)\r\n\r\nThe join section looks like:\r\n![screenshot from 2016-02-14 23-27-35](https://cloud.githubusercontent.com/assets/919933/13036861/4215c7a8-d373-11e5-953c-9d9763775a98.png)\r\n\r\nAnd the end like:\r\n![screenshot from 2016-02-14 23-27-52](https://cloud.githubusercontent.com/assets/919933/13036864/48b76e04-d373-11e5-8a23-dd5eb4618abe.png)\r\n\r\n\r\nOne can quite clearly see that 1st and 3rd track are pretty fine... but the directly read Opus is not only shifted, but also badly broken at the intersection.\r\n\r\n\r\nAnything you can do from the mpv side (like directly using libopus?) or does that need to be fixed at the ffmpex side?\r\n\r\nCheers,\r\nChris."},"comment":{"url":"https://api.github.com/repos/mpv-player/mpv/issues/comments/186363400","html_url":"https://github.com/mpv-player/mpv/issues/2823#issuecomment-186363400","issue_url":"https://api.github.com/repos/mpv-player/mpv/issues/2823","id":186363400,"user":{"login":"wm4","id":1387750,"avatar_url":"https://avatars.githubusercontent.com/u/1387750?v=3","gravatar_id":"","url":"https://api.github.com/users/wm4","html_url":"https://github.com/wm4","followers_url":"https://api.github.com/users/wm4/followers","following_url":"https://api.github.com/users/wm4/following{/other_user}","gists_url":"https://api.github.com/users/wm4/gists{/gist_id}","starred_url":"https://api.github.com/users/wm4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wm4/subscriptions","organizations_url":"https://api.github.com/users/wm4/orgs","repos_url":"https://api.github.com/users/wm4/repos","events_url":"https://api.github.com/users/wm4/events{/privacy}","received_events_url":"https://api.github.com/users/wm4/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T19:06:11Z","updated_at":"2016-02-19T19:06:11Z","body":"I also used 8.8.0. Can you upload a mkv file you produced as such? (Preferably the one which causes the gap.)\r\n\r\nAlso important for these tests: if the decoder output format changes, mpv will close and reopen the audio output, which obviously introduces a gap."}}