Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

seekTo restarts audio stream #1299

Closed
victordigio opened this issue Feb 23, 2016 · 7 comments
Closed

seekTo restarts audio stream #1299

victordigio opened this issue Feb 23, 2016 · 7 comments

Comments

@victordigio
Copy link

In some audios, when I call to seekTo, playback is restarted, and the audio start from the beginning. I think there is something wrong with the audio, but with MediaPlayer works fine.

Audio link: http://www.ivoox.com/primer-palo-19-02-16-al-infierno-los_mn_10502707_api_1.mp3
ExoPlayer version: 1.5.0
Device and android version: any

@victordigio victordigio changed the title seekTo restart audio stream seekTo restarts audio stream Feb 23, 2016
@ojw28
Copy link
Contributor

ojw28 commented Feb 23, 2016

The file contains a Xing header that's missing a table of content. If there were a table of content, the file would be seekable.

I doubt MediaPlayer is doing a particularly good job of allowing seeking. It's most likely indexing the entire file, which will significantly increase startup latency and will not scale properly to large files. In ExoPlayer we've opted to only support seeking in files that actually contain the information necessary to seek in an efficient and scalable way.

@andrewlewis - As an aside, I briefly wondered whether we should support seeking in this kind of file using a constant bitrate assumption. I gave it a try but seeking was inaccurate by over 40s in some cases for the provided sample, so I'm pretty sure this isn't a good idea. Let me know if you disagree though :).

@victordigio
Copy link
Author

Well, I guess if audio is not seekable, at least it should keep current position instead of set to 0. It would be great if could work like MediaPlayer on this cases.

@ojw28
Copy link
Contributor

ojw28 commented Feb 23, 2016

We won't be making it work like MediaPlayer, for the reasons specified above.

We should allow an application to query whether the media is seekable, so that it can avoid calling seekTo if the media is not seekable except in the case where it wishes to restart the playback. I've filed #1300 to track this.

@ojw28 ojw28 closed this as completed Feb 23, 2016
@PaulWoitaschek
Copy link

I have a similar case but I'm not sure if this is not acutally a bug @ojw28
I'll send the file by mail.

ExoPlayer 2.1.1

ffprobe -v quiet -print_format json -show_format -show_streams Chapter\ 03.mp3

{
    "streams": [
        {
            "index": 0,
            "codec_name": "mp3",
            "codec_long_name": "MP3 (MPEG audio layer 3)",
            "codec_type": "audio",
            "codec_time_base": "1/24000",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "sample_fmt": "s16p",
            "sample_rate": "24000",
            "channels": 2,
            "channel_layout": "stereo",
            "bits_per_sample": 0,
            "r_frame_rate": "0/0",
            "avg_frame_rate": "0/0",
            "time_base": "1/14112000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 44727475968,
            "duration": "3169.464000",
            "bit_rate": "64000",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 0,
                "timed_thumbnails": 0
            }
        },
        {
            "index": 1,
            "codec_name": "mjpeg",
            "codec_long_name": "Motion JPEG",
            "codec_type": "video",
            "codec_time_base": "0/1",
            "codec_tag_string": "[0][0][0][0]",
            "codec_tag": "0x0000",
            "width": 250,
            "height": 250,
            "coded_width": 250,
            "coded_height": 250,
            "has_b_frames": 0,
            "sample_aspect_ratio": "1:1",
            "display_aspect_ratio": "1:1",
            "pix_fmt": "yuvj420p",
            "level": -99,
            "color_range": "pc",
            "color_space": "bt470bg",
            "chroma_location": "center",
            "refs": 1,
            "r_frame_rate": "90000/1",
            "avg_frame_rate": "0/0",
            "time_base": "1/90000",
            "start_pts": 0,
            "start_time": "0.000000",
            "duration_ts": 285251760,
            "duration": "3169.464000",
            "bits_per_raw_sample": "8",
            "disposition": {
                "default": 0,
                "dub": 0,
                "original": 0,
                "comment": 0,
                "lyrics": 0,
                "karaoke": 0,
                "forced": 0,
                "hearing_impaired": 0,
                "visual_impaired": 0,
                "clean_effects": 0,
                "attached_pic": 1,
                "timed_thumbnails": 0
            },
            "tags": {
                "comment": "Other"
            }
        }
    ],
    "format": {
        "filename": "Chapter 03.mp3",
        "nb_streams": 2,
        "nb_programs": 0,
        "format_name": "mp3",
        "format_long_name": "MP2/3 (MPEG audio layer 2/3)",
        "start_time": "0.000000",
        "duration": "3169.464000",
        "size": "25372800",
        "bit_rate": "64043",
        "probe_score": 51,
        "tags": {
            "track": "/41",
            "artist": "Peter F. Hamilton",
            "album": "Judas Unchained",
            "genre": "Audiobook",
            "composer": "John Lee"
        }
    }
}

@ojw28
Copy link
Contributor

ojw28 commented Jan 17, 2017

Exactly the same case (Xing header that's missing a table of content).

@PaulWoitaschek
Copy link

Is it helpful to post the ffmpeg output like this? That could make future reports easier to track for you.

@ojw28
Copy link
Contributor

ojw28 commented Jan 17, 2017

Just providing the source media is best. That kind of output is normally not sufficient to debug an issue by itself, and if we have the source media we can run mediainfo/ffprobe etc on it ourselves if we need to. Thanks!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

3 participants