FFMPEG demux .264 for burning in scenarist
The demuxed H264 stream has the same metadata content, however it is rearranged, compared to the directly produced .264 stream. So far, I don't see a way to rearrange it to match.

So, transcode directly to 264 and use mp4box to generate a stream inside a container

mp4box -add direct.264 -new muxed.mp4


You can then use ffmpeg to mux to MKV.

ffmpeg -i muxed.mp4 -c copy muxed.mkv


mp4box is part of the GPAC project. Get a nightly build from https://gpac.wp.imt.fr/downloads/gpac-nightly-builds/



To do this entirely within ffmpeg, you can use the tee muxer to pipe a AVI mux to another ffmpeg instance

ffmpeg -i input.mov -map 0:v -vsync cfr -r fps -pix_fmt yuv420p -c:v libx264 -preset fast -tune film -b:v 20000k -maxrate 35000k -bufsize 30000k -level 4.1 -x264opts bluray-compat=1:open-gop=1:slices=4:keyint=24 -f tee "scenarist.264|[f=avi]pipe:1" | ffmpeg -f avi -i - -c copy -y playback.mkv

Verify the