This is similar to one of two questions that any reasonable person would ask at the first attempt to deal with the video, programmatically. "Why can't I just cut and paste the parts I need?" No one answers, because people who can really explain are tired of the question, and people like me who understand this themselves do not want to look stupid. But I do not mind - this is the practical answer.
To copy and combine complex container formats, it is always more complicated than you think, and requires at least a solution for each container.
If you read ffmpeg faq, you could theoretically combine the videos by reformatting them as mpg-v1 (maybe mpg-v2 also works) and then do more or less of what you do.
cat first_part.mpg second_part.mpg > joined_movie.mpg
In practice, join_movie.mpg may or may not work smoothly. Even in this very simple format, there is some data that seems to say that โthis file is minuteโ or something like that. Thus, you can open it and open for it only 30 seconds, but find that it plays a minute (or not, depending on the player). This can be easily fixed (and I assume that it is lossless, or it is not recommended in ffmpeg faq).
But you probably don't want to work with mpg-v1, ultimately. Webm may be the smart choice. From what I collect, the web container is sourced from MKV. For audio, vorbis is used, and for video, vp8 is used. One layman to another: vp8 ~ H264 (I apologize to any of the doom9 forums that read this and have a heart attack). In any case, for us, the laity, an important point: this means that it is not only not simple, but actually super complex - even just understanding all the parameters of the encoder is a vital job.
I know that mp4box can do something pretty close to what you want with the h264 video inside the mp4 container. If you basically want to cut and join the video programmatically, you can of course just accept mp4 / h264, but you can be free and much more, and want to use webm for ideological or monetary reasons. If you find a solution in webm, I will be interested. Perhaps mkvtool would work, given its proximity to the mkv container?
I assume your files are prepared for streaming, given that you are talking about web video. Therefore, it might seem that you really really should be able to just add them together. But even with everything that alternates with a piece, it should be a little more complicated than just adding them, or even adding them, and then adjusting the title / metadata for the total playing time. I invent complexity because it seems that there are not many tools that will work, and even mp4box could not always do this reliably / accurately.
If you are using mp4, you can tell mp4box to attach files with:
mp4box -cat file1 -cat file2 -new joined
Perhaps a patriot with free software will publish how to cut and attach web files from the command line without transcoding.
Good luck with your project.