I'm trying to make a simulated live HLS/DASH server using the equivalent of the following chain:
tsplay -loop multi_resolution.ts | shaka_packager | nginx
The problem is creating the file "multi_resolution.ts": It needs to contain a single program with 1 audio and 3 video PIDs, one each for 720p, 480p and 360p. Why? Because that's the way shaka_packager needs it to be.
I think I'm confused by how to map the transcoded streams to the output file. Here the non-working command I've been struggling with:
ffmpeg -i "big_buck_bunny_1080p.mov" -threads 16 \
-c:a aac -ac 2 -b:a:0 128k \
-c:v libx264 -pix_fmt yuv420p -profile:v high -level 4.0 -preset veryslow -tune film \
-vsync cfr -x264-params "nal-hrd=cbr" \
-b:v:1 5000k -minrate 2000k -maxrate 2000k -bufsize 4000k -g 30 -s 1280x720 \
-c:v libx264 -pix_fmt yuv420p -profile:v high -level 4.0 -preset veryslow -tune film \
-vsync cfr -x264-params "nal-hrd=cbr" \
-b:v:2 1500k -minrate 1000k -maxrate 1000k -bufsize 2000k -g 30 -s 854x480 \
-c:v libx264 -pix_fmt yuv420p -profile:v high -level 4.0 -preset veryslow -tune film \
-vsync cfr -x264-params "nal-hrd=cbr" \
-b:v:3 500k -minrate 500k -maxrate 500k -bufsize 1000k -g 30 -s 640x360 \
-program program_num=1:title=multi_p30:st=0:st=1:st=2:st=3 \
-f mpegts "big_buck_bunny_720_480_360.ts"
I tested each of the encodings in isolation, and they look good. I suspect the problem is with my stream management/mapping.
Help?