Chunk demuxer error append failed как исправить
Перейти к содержимому

Chunk demuxer error append failed как исправить

  • автор:

Chromium — Media source extension — Append: stream parsing failed

Using Media source extension (MSE), I am trying to play an mp4 stream on web browser. On firefox it’s ok. On chromium based web browser (Opera, Chrome and Edge), it’s not. I have the error :

Append: stream parsing failed. Data size=689 append_window_start=0 append_window_end=inf

My javascript receive fragments of the mp4 file and append them to MSE. Appending the first fragment of my mp4 containing the ftyp box atom, works fine. But appending second fragment containing the moov atom give me the error and then close the media source.

I didn’t find out what’s wrong on the moov atom. Did someone see what’s going on with this moov atom?

Here is a screenshot of the hexa of the second fragment (containing moov atom) I send and there of the Chrome Media Internals log

Concatenating all 327 fragments give me a readable mp4 file readable with VLC, html video tag.

I have tried reading the mp4 directly as file in vidéo tag in chromium, it works.

Javascript – How to fix CHUNK_DEMUXER_ERROR_APPEND_FAILED error when append chunk

I want to create a video player that can play multiple resolution, so I have to load chunks of different codecs.

I tried to append chunk of the same codec and it work. So I tried to use changeType() but when I append the new codec chunk in the video element I found this error "CHUNK_DEMUXER_ERROR_APPEND_FAILED: Append: stream parsing failed.".

How can I fix it?

Best Solution

You almost certainly don't need to use changeType here, since that is typically used for changing codec (eg avc -> hevc) or container (eg mp4 -> webm), whereas you are simply switching within the same codec and container.

The problem is almost certainly that you aren't appending an initialisation segment on a quality change — you only do this for the first quality level.

Fix: insert an appropriate initialisation segment before the first media segment of each new quality.

Related Solutions
Javascript – How do JavaScript closures work

A closure is a pairing of:

  1. A function, and
  2. A reference to that function's outer scope (lexical environment)

A lexical environment is part of every execution context (stack frame) and is a map between identifiers (ie. local variable names) and values.

Every function in JavaScript maintains a reference to its outer lexical environment. This reference is used to configure the execution context created when a function is invoked. This reference enables code inside the function to "see" variables declared outside the function, regardless of when and where the function is called.

If a function was called by a function, which in turn was called by another function, then a chain of references to outer lexical environments is created. This chain is called the scope chain.

In the following code, inner forms a closure with the lexical environment of the execution context created when foo is invoked, closing over variable secret :

In other words: in JavaScript, functions carry a reference to a private "box of state", to which only they (and any other functions declared within the same lexical environment) have access. This box of the state is invisible to the caller of the function, delivering an excellent mechanism for data-hiding and encapsulation.

And remember: functions in JavaScript can be passed around like variables (first-class functions), meaning these pairings of functionality and state can be passed around your program: similar to how you might pass an instance of a class around in C++.

If JavaScript did not have closures, then more states would have to be passed between functions explicitly, making parameter lists longer and code noisier.

So, if you want a function to always have access to a private piece of state, you can use a closure.

. and frequently we do want to associate the state with a function. For example, in Java or C++, when you add a private instance variable and a method to a class, you are associating state with functionality.

In C and most other common languages, after a function returns, all the local variables are no longer accessible because the stack-frame is destroyed. In JavaScript, if you declare a function within another function, then the local variables of the outer function can remain accessible after returning from it. In this way, in the code above, secret remains available to the function object inner , after it has been returned from foo .

Uses of Closures

Closures are useful whenever you need a private state associated with a function. This is a very common scenario — and remember: JavaScript did not have a class syntax until 2015, and it still does not have a private field syntax. Closures meet this need.

Private Instance Variables

In the following code, the function toString closes over the details of the car.

Как правильно хостить и проигрывать видео в 2020?

Добрый вечер!
Мы недавно реализовали проект фестиваля, на сайте которого можно было посмотреть полнометражные фильмы.
В целом все прошло хорошо, но сейчас очень остро стоит вопрос относительно технологий которые для этого использовались, потому что очень явно ощущается, что что-то пошло не так, а на горизонте уже маячат похожие проекты.

Начитавшись того, как «правильно» должна выглядеть подобная реализация, решили заюзать эпловский HLS.
Конвертнули все видео-дорожки для разного качества при помощи ffmpeg. Разбили все файлы на видео-аудио дорожки при помощи mediafilesegmenter, mediasubtitlesegmenter — создали плейлисты при помощи variantplaylistcreator.
Получили класный master.m3u8 файл плейлиста, где все эти конфиги были красиво описаны.
И вроде бы на клиенте получаем полностью работоспособную систему, которая отлично работает. но не тут то было.

Когда на проект запустили пользователей — массово посыпались жалобы, у кого-то не грузит видео, кто-то ловит ошибки декода (chunk_demuxer_error_append_failed append stream parsing failed) у кого-то видео зависает на каких-то этапах и на отказ перестает грузиться. Это при том, что в первый день онлайн был не более 200 одновременных просмотров, а нагрузка по трафику из доступных 3гб\сек не превышала и 1\3.
Другими словами, пошла какая-то лажа.

Так как делать нужно было что-то срочно, решили от m3u8 файлов отказаться и перейти на отдачу цельных файлов сразу. В конфигах просто прописали ссылки на mp4 файлы, в которых сразу находилось всего одна аудио и видео дорожка. И чудо — все ошибки сразу пропали.
То есть получается, что отдача одним файлом и браузерный декод, вышли намного эффективнее чем то, что мы делали через HLS. ¯\_( ツ)_/¯

Мы посмотрели кучу стриминговых сервисов, большая часть из них отдавала все свои стримы в формате m3u8, и никаких проблем при этом люди не испытывали. Соответственно назрела куча вопросов о том, как таки стоит делать и в чем могла быть ошибка и как это исправить на будущее.

1) Как правильно хостить файлы на сервере? Нужна ли разбивка при помощи HLS\DASH? Где-то видел что эти технологии нужно использовать в паре, так как каждая из них имеет свою браузерную поддержку.

2) Должны ли быть на сервере какие-то специфичные настройки, для эффективной отдачи статического медиа-контента?

3) Медиа-плеер. Возможно, причина ошибок связана с плеером, который использовали на клиенте? Мы использовали https://flowplayer.com/.
Наслышан о таких плеерах, как Movie.js Shaka Player, jwplayer — возможно есть смысл попробовать какой-то из них? Плеер не обязательно бесплатный, просто хочется использовать технологию, которая сможет дать максимальное покрытие. Например, в этом проекте, люди заходили с телевизора, а на tizen flowplayer не работал, от слова совсем.

4) Шифрование\защита файлов. Как по мне отдача чистых mp4 файлов, небезопасна от слова совсем. Понятное дело, что собрать готовый файл с плейлиста, можно одной командой из ffmpeg, но в той реализации которая вышла, достаточно просто открыть дев. тулзы и получить прямую ссылку на файл который можно сохранить себе на пк.

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

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

Already on GitHub? Sign in to your account

CHUNK_DEMUXER_ERROR_APPEND_FAILED: Append: stream parsing failed. works in reference client not our app #4070

CHUNK_DEMUXER_ERROR_APPEND_FAILED: Append: stream parsing failed. works in reference client not our app #4070

Comments

Environment
  • The MPD passes the DASH-IF Conformance Tool on https://conformance.dashif.org/
  • The stream has correct Access-Control-Allow-Origin headers (CORS)
  • There are no network errors such as 404s in the browser console when trying to play the stream
  • The issue observed is not mentioned on https://github.com/Dash-Industry-Forum/dash.js/wiki/FAQ
  • [] The issue occurs in the latest reference client on http://reference.dashif.org/dash.js/ and not just on my page
  • Link to playable MPD file: https://howio-dev-public.s3.ap-southeast-2.amazonaws.com/bad-video/assets/org/1/folder/191/e3bb3994-b0ec-4ba0-a368-09341ae1084e/cmaf.mpd
  • Dash.js version: 4.5.0
  • Browser name/version: Chrome 106.0.5249.119
  • OS name/version: Window 10
Steps to reproduce
  1. Please provide clear steps to reproduce your problem
  2. If the bug is intermittent, give a rough frequency if possible

I’m trying to understand why this video plays in the latest reference client but not in our app.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *