debugly / ijkplayer

iOS/macOS/tvOS video player based on ijkplayer, using FFmpeg 6, support Metal、hw accel、HDR、ass subtitle effect...
https://ijkplayer.debugly.cn/
GNU General Public License v2.0
116 stars 20 forks source link

MOV格式视频播放卡顿 #14

Open zdw19840929 opened 7 months ago

zdw19840929 commented 7 months ago

大佬,我在播放MOV格式视频的时候卡顿,看log貌似获取视频留的时候有问题,总是关闭再重连,这是log,麻烦大佬看下,谢谢啦 @debugly

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=1376579-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=3204181-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=1377664-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=3221610-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=1378271-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]ffp_toggle_buffering_l: end [IJKMEDIA]aout_pause_audio(1) [IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=2264815-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=3318849-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=2265375-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=3343440-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=2265925-

Connection: close

Host:

Icy-MetaData: 1

[IJKMEDIA]Original list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Interleaved list of addresses: [IJKMEDIA]Address 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Starting connection attempt to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]Successfully connected to 2409:8a00:603b:7f40:c868:dec4:d20f:2 port 5000 [IJKMEDIA]request: GET /fbdownload/IMG_3494.mov?dlink=%222F686F6D652FE88081E5A986E79A84E8A786E9A2912F494D475F333439342E6D6F76%22&_sid=AiGZKYgpxIE_1JVT3CwLpZHPtGtrVFMrhn20qL0sORkHzSE-yZM0MAHVka5KwPzLh0YgHzfF7yIpAk8pk5syQo&mime=1 HTTP/1.1

User-Agent: ijkplayer

Accept: /

Range: bytes=3422085-

Connection: close

Host:

Icy-MetaData: 1

zdw19840929 commented 7 months ago

大佬,我查了下,知道了问题所在,但是不知道修改哪里。 我的视频音频的channels是2,这时候在线播放视频就会变得特别卡,但如果我用ffmpeg -i IMG_3493.MOV -ac 1 IMG_3493Out.MOV将channels变成1就可以流畅的浏览了。

"streams": [ { "index": 0, "codec_name": "aac", "codec_long_name": "AAC (Advanced Audio Coding)", "profile": "LC", "codec_type": "audio", "codec_tag_string": "mp4a", "codec_tag": "0x6134706d", "sample_fmt": "fltp", "sample_rate": "44100", "channels": 2, "channel_layout": "stereo", "bits_per_sample": 0, "initial_padding": 0, "id": "0x1", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/44100", "start_pts": 0, "start_time": "0.000000", "duration_ts": 7003136, "duration": "158.801270", "bit_rate": "128376", "nb_frames": "6839", "extradata_size": 2, "disposition": { "default": 1, "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, "non_diegetic": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2020-11-24T09:46:40.000000Z", "language": "und", "vendor_id": "[0][0][0][0]" } }, { "index": 1, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "High", "codec_type": "video", "codec_tag_string": "avc1", "codec_tag": "0x31637661", "width": 640, "height": 360, "coded_width": 640, "coded_height": 360, "closed_captions": 0, "film_grain": 0, "has_b_frames": 2, "pix_fmt": "yuv420p", "level": 30, "chroma_location": "left", "field_order": "progressive", "refs": 1, "is_avc": "true", "nal_length_size": "4", "id": "0x2", "r_frame_rate": "24000/1001", "avg_frame_rate": "19015/794", "time_base": "1/90000", "start_pts": 7516, "start_time": "0.083511", "duration_ts": 14292000, "duration": "158.800000", "bit_rate": "488310", "bits_per_raw_sample": "8", "nb_frames": "3803", "extradata_size": 40, "disposition": { "default": 1, "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, "non_diegetic": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2020-11-24T09:46:40.000000Z", "language": "und", "vendor_id": "[0][0][0][0]", "encoder": "JVT/AVC Coding" } } ]

debugly commented 6 months ago

请提供个测试视频给我,我这的mov视频没有这个问题,大概率和mov格式无关。

zdw19840929 commented 6 months ago

IMG_3394.MOV.zip @debugly 大佬可以看下这个视频

debugly commented 6 months ago

这个视频我放到局域网的文件服务器上,和本地播放是一样的效果,没看有什么区别。 你那很明显吗?

zdw19840929 commented 6 months ago

这个视频我放到局域网的文件服务器上,和本地播放是一样的效果,没看有什么区别。 你那很明显吗?

我上传的视频可能有点短,大佬可以看下这个视频,卡顿就明显了 { "streams": [ { "index": 0, "codec_name": "h264", "codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "profile": "Main", "codec_type": "video", "codec_tag_string": "avc1", "codec_tag": "0x31637661", "width": 1280, "height": 720, "coded_width": 1280, "coded_height": 720, "closed_captions": 0, "film_grain": 0, "has_b_frames": 2, "pix_fmt": "yuv420p", "level": 31, "chroma_location": "left", "field_order": "progressive", "refs": 1, "is_avc": "true", "nal_length_size": "4", "id": "0x1", "r_frame_rate": "20/1", "avg_frame_rate": "20/1", "time_base": "1/20000", "start_pts": 0, "start_time": "0.000000", "duration_ts": 30308000, "duration": "1515.400000", "bit_rate": "272107", "bits_per_raw_sample": "8", "nb_frames": "30308", "extradata_size": 39, "disposition": { "default": 1, "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, "non_diegetic": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2019-04-28T07:58:32.000000Z", "language": "und", "handler_name": "VideoHandler", "vendor_id": "[0][0][0][0]" } }, { "index": 1, "codec_name": "aac", "codec_long_name": "AAC (Advanced Audio Coding)", "profile": "HE-AAC", "codec_type": "audio", "codec_tag_string": "mp4a", "codec_tag": "0x6134706d", "sample_fmt": "fltp", "sample_rate": "44100", "channels": 2, "channel_layout": "stereo", "bits_per_sample": 0, "initial_padding": 0, "id": "0x2", "r_frame_rate": "0/0", "avg_frame_rate": "0/0", "time_base": "1/22050", "start_pts": 0, "start_time": "0.000000", "duration_ts": 33419264, "duration": "1515.612880", "bit_rate": "72191", "nb_frames": "32636", "extradata_size": 7, "disposition": { "default": 1, "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, "non_diegetic": 0, "captions": 0, "descriptions": 0, "metadata": 0, "dependent": 0, "still_image": 0 }, "tags": { "creation_time": "2019-04-28T07:58:33.000000Z", "language": "und", "handler_name": "AudioHandler", "vendor_id": "[0][0][0][0]" } } ] }

https://music-pool.oss-cn-qingdao.aliyuncs.com/testvideo.mp4

debugly commented 6 months ago

ffmpeg http 模块的问题,修改 ffmpeg 不太好解决。