play-from-disk-mkv demonstrates how to send video and/or audio to your browser from a MKV file
This example has the same structure as play-from-disk but instead reads from a MKV file
ffmpeg -i $INPUT_FILE -c:v libx264 -b:v 2M -max_delay 0 -bf 0 -g 30 -c:a libopus -page_duration 20000 output.mkv
go install github.com/pion/example-webrtc-applications/v3/play-from-disk-mkv@latest
jsfiddle.net you should see two text-areas and a 'Start Session' button
The output.mkv
you created should be in the same directory as play-from-disk-mkv
. In the jsfiddle the top textarea is your browser, copy that and:
Run echo $BROWSER_SDP | play-from-disk-mkv
- Paste the SessionDescription into a file.
- Run
play-from-disk-mkv < my_file
Copy the text that play-from-disk-mkv
just emitted and copy into second text area
A video should start playing in your browser above the input boxes. play-from-disk-mkv
will exit when the file reaches the end
Congrats, you have used Pion WebRTC! Now start building something cool