diff --git a/extract-playlist.php b/extract-playlist.php
index 36c1f35..263d26d 100644
--- a/extract-playlist.php
+++ b/extract-playlist.php
@@ -773,9 +773,7 @@ if ( $ext === '.mp3' ) {
} else {
die( "Unexpected file extension $ext\n" );
}
-if ( $ext === '.mp3' ) {
- $segments = consolidate( $target, $segments );
-}
+$segments = consolidate( $target, $segments );
/*
foreach ( $segments as $key => $segment ) {
diff --git a/fmp4.html b/fmp4.html
index 95df6ce..471044d 100644
--- a/fmp4.html
+++ b/fmp4.html
@@ -24,13 +24,14 @@
+
Current behavior:
Browsers that play the VP9 track will get sharp video, those that play the MJPEG track will get blurry video. Audio should sound the same either way.
- MSE-based streaming with VHS
- Firefox seems to work with VP9 & Opus tracks via video.js
- - Chrome seems unhappy, something in the MSE is not ok with the VP9 first segment?
+ - Chrome works (needed to fix an output setting)
- (disabled) Safari uses the MP3 audio tracks and VHS gets confused because it tries to parse them as MP4 (not Safari's fault)
diff --git a/make-fmp4.sh b/make-fmp4.sh
index 07db65e..b57c062 100755
--- a/make-fmp4.sh
+++ b/make-fmp4.sh
@@ -1,7 +1,6 @@
interval=10
-#MOVFLAGS="-movflags +frag_keyframe+empty_moov -force_key_frames expr:gte(t,n_forced*$interval)"
-MOVFLAGS="-movflags +frag_keyframe+empty_moov"
-AUDFLAGS="-movflags +empty_moov -frag_duration ${interval}000000"
+MOVFLAGS="-movflags +frag_keyframe+empty_moov+default_base_moof"
+AUDFLAGS="-movflags +empty_moov+default_base_moof -frag_duration ${interval}000000"
BITRATE_HI="-b:v 1250k"
BITRATE_LO="-b:v 1000k"
@@ -23,30 +22,35 @@ INFILE=caminandes-llamigos.webm
set -e
+if [ false ]
+then
+
# Audio for HLS
-#ffmpeg -i $INFILE -vn $AUDIO_MP3 -y fmp4.audio.mpeg.mp3
-#ffmpeg -i $INFILE -vn $AUDIO_MP3 $AUDFLAGS -y fmp4.audio.mpeg.mp4
-#ffmpeg -i $INFILE -vn $AUDIO_MP3 $AUDFLAGS -y fmp4.audio.mpeg.mov
-#ffmpeg -i $INFILE -vn $AUDIO_AAC $AUDFLAGS -y fmp4.audio.aac.mp4
-#ffmpeg -i $INFILE -vn $AUDIO_OPUS $AUDFLAGS -y fmp4.audio.opus.mp4
+ffmpeg -i $INFILE -vn $AUDIO_MP3 -y fmp4.audio.mpeg.mp3
+ffmpeg -i $INFILE -vn $AUDIO_MP3 $AUDFLAGS -y fmp4.audio.mpeg.mp4
+ffmpeg -i $INFILE -vn $AUDIO_MP3 $AUDFLAGS -y fmp4.audio.mpeg.mov
+ffmpeg -i $INFILE -vn $AUDIO_AAC $AUDFLAGS -y fmp4.audio.aac.mp4
+ffmpeg -i $INFILE -vn $AUDIO_OPUS $AUDFLAGS -y fmp4.audio.opus.mp4
# Video for HLS
-#ffmpeg -i $INFILE -an $VIDEO_VP9 $MOVFLAGS -pass 1 -y fmp4.480p.vp9.mp4
-#ffmpeg -i $INFILE -an $VIDEO_VP9 $MOVFLAGS -pass 2 -y fmp4.480p.vp9.mp4
+ffmpeg -i $INFILE -an $VIDEO_VP9 $MOVFLAGS -pass 1 -y fmp4.480p.vp9.mp4
+ffmpeg -i $INFILE -an $VIDEO_VP9 $MOVFLAGS -pass 2 -y fmp4.480p.vp9.mp4
-#ffmpeg -i $INFILE -an $VIDEO_H264 $MOVFLAGS -pass 1 -y fmp4.480p.h264.mp4
-#ffmpeg -i $INFILE -an $VIDEO_H264 $MOVFLAGS -pass 2 -y fmp4.480p.h264.mp4
+ffmpeg -i $INFILE -an $VIDEO_H264 $MOVFLAGS -pass 1 -y fmp4.480p.h264.mp4
+ffmpeg -i $INFILE -an $VIDEO_H264 $MOVFLAGS -pass 2 -y fmp4.480p.h264.mp4
-#ffmpeg -i $INFILE -an $VIDEO_MPEG4 $MOVFLAGS -pass 1 -y fmp4.480p.mpeg4.mp4
-#ffmpeg -i $INFILE -an $VIDEO_MPEG4 $MOVFLAGS -pass 2 -y fmp4.480p.mpeg4.mp4
+ffmpeg -i $INFILE -an $VIDEO_MPEG4 $MOVFLAGS -pass 1 -y fmp4.480p.mpeg4.mp4
+ffmpeg -i $INFILE -an $VIDEO_MPEG4 $MOVFLAGS -pass 2 -y fmp4.480p.mpeg4.mp4
-#ffmpeg -i $INFILE -an $VIDEO_H263 $MOVFLAGS -y fmp4.288p.h263.3gp
+ffmpeg -i $INFILE -an $VIDEO_H263 $MOVFLAGS -y fmp4.288p.h263.3gp
# Note use duration, not keyframe interval, for fragments,
# because all are keyframes!
-#ffmpeg -i $INFILE -an $VIDEO_MJPEG $AUDFLAGS -y fmp4.120p.mjpeg.mp4
-#ffmpeg -i $INFILE -an $VIDEO_MJPEG $AUDFLAGS -y fmp4.120p.mjpeg.mov
+ffmpeg -i $INFILE -an $VIDEO_MJPEG $AUDFLAGS -y fmp4.120p.mjpeg.mp4
+ffmpeg -i $INFILE -an $VIDEO_MJPEG $AUDFLAGS -y fmp4.120p.mjpeg.mov
+
+fi
# Playlist processing
php extract-playlist.php fmp4.audio.mpeg.mp3 > fmp4.audio.mpeg.mp3.m3u8
@@ -89,3 +93,5 @@ php meta-playlist.php fmp4 audio.opus.mp4 $MPEG_TRACK 480p.vp9.mp4 120p.mjpeg.mp
php meta-playlist.php fmp4 audio.opus.mp4 $MPEG_TRACK 480p.vp9.mp4 120p.mjpeg.mov > fmp4.vp9-mjpeg.mov.m3u8
php meta-playlist.php --lie fmp4 audio.opus.mp4 $MPEG_TRACK 480p.vp9.mp4 120p.mjpeg.mp4 > fmp4.vp9-mjpeg.lie.m3u8
php meta-playlist.php --lie fmp4 audio.opus.mp4 $MPEG_TRACK 480p.vp9.mp4 120p.mjpeg.mov > fmp4.vp9-mjpeg.mov.lie.m3u8
+
+php meta-playlist.php fmp4 audio.opus.mp4 audio.mpeg.mov 480p.vp9.mp4 120p.mjpeg.mov > fmp4.vp9-mjpeg.mov-mp3.mov.m3u8