This commit is contained in:
Brooke Vibber 2023-03-30 12:18:37 -07:00
parent 27d798f8a3
commit 0ee72681ff
3 changed files with 26 additions and 21 deletions

View file

@ -773,9 +773,7 @@ if ( $ext === '.mp3' ) {
} else {
die( "Unexpected file extension $ext\n" );
}
if ( $ext === '.mp3' ) {
$segments = consolidate( $target, $segments );
}
/*
foreach ( $segments as $key => $segment ) {

View file

@ -24,13 +24,14 @@
</video>
</div>
<p>Current behavior:</p>
<p>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.</p>
<ul>
<li>MSE-based streaming with VHS
<ul>
<li>Firefox seems to work with VP9 & Opus tracks via video.js</li>
<li>Chrome seems unhappy, something in the MSE is not ok with the VP9 first segment?</li>
<li>Chrome works (needed to fix an output setting)</li>
<li>(disabled) Safari uses the MP3 audio tracks and VHS gets confused because it tries to parse them as MP4 (not Safari's fault)</li>
</ul>
</li>

View file

@ -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