GoogleChrome / kino

A sample offline streaming video PWA built for web.dev/media
https://kinoweb.dev
Apache License 2.0
101 stars 25 forks source link

Could not append initialization segment to source buffer #173

Open quanhoang288 opened 2 years ago

quanhoang288 commented 2 years ago

Bug Description

I'm cloning this project and making use of the streamer class for VOD streaming but could not append initialization segment to source buffer. I think my encoding and generating dash segments has some problems since i was following another tutorial to generate dash segemtns. Could you provide the ffmpeg commands used for segmenting the original video and generate MPD file ? I've been stuck on this problem for 2 days without any solution. I'd appreciate it if you could share the ffmpeg commands. Thanks in advance!

derekherman commented 2 years ago

@dero could you please provide Quân with a few examples of the commands you’re using to generate the manifests when you’re back online.

quanhoang288 commented 2 years ago

@derekherman I was following this tutorial to generate 3 different representations. I dont have much experience with video encoding so I just pretty much copied the script

Here's the link to the tutorial: https://blog.infireal.com/2018/04/mpeg-dash-with-only-ffmpeg/

Here's the generated ffmpeg command for segmenting into chunks and generating manifest file:

ffmpeg -i D:\Hoc Tap\Project III\VideoStreaming\react-node-video-streaming\server\tmp\file_example_MP4_1920_18MG-
1639910101254\file_example_MP4_1920_18MG-1639910101255.mp4 -y -acodec aac -ac 2 -ar 44100 -vcodec libx264 -f dash 
-preset veryfast -keyint_min 60 -g 60 -sc_threshold 0 -profile:v main -use_template 1 -use_timeline 1 -b_strategy 0 -bf 1 -map 
0:a? -b:a 96k -filter_complex [0]format=pix_fmts=yuv420p[temp0];[temp0]scale=-2:240[A0] -map [A0]:v -b:v:0 350k 
-filter_complex [0]format=pix_fmts=yuv420p[temp1];[temp1]scale=-2:480[A1] -map [A1]:v -b:v:1 700k 
-filter_complex [0]format=pix_fmts=yuv420p[temp2];[temp2]scale=-2:720[A2] -map [A2]:v -b:v:2 2500k 
D:\Hoc Tap\Project III\VideoStreaming\react-node-video-streaming\server\tmp\file_example_MP4_1920_18MG-1639910101254\file_example_MP4_1920_18MG-1639910101255.mpd

I honestly don't understand most of the things inside the command and just managed to run and generate the segments and manifest which I thought would run. Maybe there's something wrong with this command ? I'd be best if you could share some sample commands to correctly generate the segments and manifest :D

quanhoang288 commented 2 years ago

@derekherman i'm really sorry if i keep asking for ffmpeg commands that you used but i really need them now to have a look since i'm doing a school project and the deadline is about to be due :( The streaming part is the core part of my project so I managed to set up everything but could not load chunk to the buffer. I'd very much appreciate it if you could provide (or ask s.o handling this part) some examples of the commands soon. Thank you for replying my issue!

dero commented 2 years ago

@quanhoang288 The commands used to generate the sample videos are a part of the posts that explain streaming:

See the "Example FFmpeg command" section in both of those posts. Do those help?

quanhoang288 commented 2 years ago

@dero thanks a lot, i'll check it out and see if it works xD

quanhoang288 commented 2 years ago

@dero I'm sorry for bothering again but it didn't seem to work for me. I was able to encode the video but it throws this error when trying to load the initialization segment to the buffer: image When I use the media tool in Chrome it gives me this error: Invalid top-level ISO BMFF box type 0xbfbd6d6f Could you give me some insights on this ? Thank you

quanhoang288 commented 2 years ago

@derekherman could you help me take a look at the problem for a bit ? I reference kino generated manifests and they look similar to mine but somehow it still didnt work. Any insight would be appreciated