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.Dismiss alert
Split audio and video using ffmpeg (ffmpeg -y -i %INPUT_FILE% -c:v copy -an -f mp4 -movflags faststart+frag_every_frame+empty_moov+default_base_moof %TEMP_FOLDER%\video.mp4) and (-vn -c:a copy %TEMP_FOLDER%\audio.m4a)
Fragment using bento4 (both audio and video) mp4fragment --fragment-duration %FRAGMENT_DURATION% %TEMP_FOLDER%\audio.m4a %TEMP_FOLDER%\audio_f.m4a
Encrypt and package to hls mp4hls --hls-version 4 --output-dir=%HLS_FOLDER% --force --encryption-key=7cc723769be333bc4703df267e2833c4 --output-encryption-key --encryption-mode=AES-128 %TEMP_FOLDER%\audio_f.m4a %TEMP_FOLDER%\video_f.mp4
When I try the file via hls.js the file does not play. The player error handler returns the following: type: "mediaError", details: "fragParsingError", fatal: false, reason: "TS packet did not start with 0x47"
I tried the same mp4hls without encryption and it works fine, so it should not be a codec issue.
Same if I omit the audio_f.m4a source from the m3u8, the video only m3u8 works fine
hls.js playback fails with "fragParsingError" "TS packet did not start with 0x47" in id:"audio" stream for AES-128 encrypted file
For testing, I have downloaded a sample MP4 file https://www.appsloveworld.com/download-sample-mp4-video-mp4-test-videos/ and generated an m3u8 as follows:
(ffmpeg -y -i %INPUT_FILE% -c:v copy -an -f mp4 -movflags faststart+frag_every_frame+empty_moov+default_base_moof %TEMP_FOLDER%\video.mp4) and (-vn -c:a copy %TEMP_FOLDER%\audio.m4a)
mp4fragment --fragment-duration %FRAGMENT_DURATION% %TEMP_FOLDER%\audio.m4a %TEMP_FOLDER%\audio_f.m4a
mp4hls --hls-version 4 --output-dir=%HLS_FOLDER% --force --encryption-key=7cc723769be333bc4703df267e2833c4 --output-encryption-key --encryption-mode=AES-128 %TEMP_FOLDER%\audio_f.m4a %TEMP_FOLDER%\video_f.mp4
When I try the file via hls.js the file does not play. The player error handler returns the following:
type: "mediaError", details: "fragParsingError", fatal: false, reason: "TS packet did not start with 0x47"
I tried the same mp4hls without encryption and it works fine, so it should not be a codec issue.
Same if I omit the audio_f.m4a source from the m3u8, the video only m3u8 works fine
You can download and try to replicate from here
Tested on Chrome latest, Firefox latest (Win 10 )
Any ideas on how fix this would be greatly appreciated.
The text was updated successfully, but these errors were encountered: