For SD movies and TV editing I use VSDC Video Editor. It accepts all video files (avi mp4 mkv etc..) and can output a variety of format DIVX/XVID (although I don't personally) and H264/H265. The only drawback is that it is limited to outputting Dolby Digital stereo only @ 320kbps (Not 5.1) as well as mp3, aac @ 320kbps. I mainly use it for editing out adverts from films and tv that I have recorded from a standard definition source.
For HD movies and TV I use SolveigMM AVI trimmer. It is not as accurate as VSDC but it does retain the 5.1 Dolby Digital Sound. You just cut out the bits you don't want and it joins the remaining parts together automatically. The saved file is an MKV.
Both are free.
Hope this helps.
CCF