FFMPEG mp4视频不会突然停止在浏览器中播放

时间:2020-01-13 07:45:28

标签: laravel video ffmpeg html5-video ffmpeg-php

在使用 FFMPEG 转换后的mp4视频转换为 html 5视频播放器方面,我一直在努力解决这个问题,基本上只需使用一个视频播放器,并在视频结束时替换源即可。

发生的情况是 MediaError 随机出现在不同的视频中,并显示:

PIPELINE_ERROR_DECODE: Failed to send audio packet for decoding

PIPELINE_ERROR_DECODE: audio decode error

Safari Internet Explorer Firefox 上,视频没有问题。但是此错误会随机显示在 Opera Google Chrome 上。

我正在使用Laravel [Laravel FFMpeg] [1]转换视频,请在下面查看我的转换代码

$bitrateFormat = (new FFMpeg\Format\Video\X264('aac', 'libx264'))->setKiloBitrate(1500);

$converted_video = FFMpeg::fromDisk('videos')
    ->open($this->video_id)
    ->addFilter(['-pix_fmt', 'yuv420p'], ['-movflags', '+faststart'])
    ->export()
    ->inFormat($bitrateFormat)
    ->toDisk('do_spaces_video')
    ->save($this->video_id);

任何人都会感谢您,在此先感谢您!

编辑-添加了媒体内部错误

00:04:02.892    for_suspended_start false
00:04:02.892    pipeline_buffering_state    BUFFERING_HAVE_ENOUGH
00:04:33.919    error   Failed to send audio packet for decoding: timestamp=272341333 duration=21333 size=346 side_data_size=0 is_key_frame=1 encrypted=0 discard_padding (us)=(0, 0)
00:04:33.919    error   audio decode error
00:04:33.943    error   audio error during playing, status: PIPELINE_ERROR_DECODE
00:04:33.943    pipeline_error  PIPELINE_ERROR_DECODE
00:04:33.944    pipeline_state  kStopping
00:04:33.945    pipeline_state  kStopped
00:04:33.950    event   PAUSE

0 个答案:

没有答案
相关问题