For a test case I downloaded a copyright free video via torrent(Destroy All Planets) from The Internet Archive. As it contained a number of files in different multimedia containers at different bitrates I chose the highest quality version which was Destroy_All_Planets.mpeg which was 720x480 at 30 fps and a MPEG2 video stream with a variable video bitrate of ~3000 kbps (6000 kbps max per mediainfo
and a AC-3 audio stream sampled at 48000 Hz with bitrate of 192 kbps. I attempted conversion to all the multimedia container types I could find. using the command avconv infile -c:a copy -c:v copy outfile
The AVI attempt appears to have defaulted to uncompressed and was clearly re-encoded (or unpacked) as there was a substantial increase in size and an adjustment to 90fps with a bitrate of 15.9 Mbps. Several other containers failed to accept the data input and can be seen in the results with a 0 file size. According to the results of this test MP4 and MOV containers appear to be the most efficient (tied for 1st place) with the Matroska container a solid 3rd place finish. All other multimedia containers tested resulted in an actual increase in size over the source material.
11036656 Destroy_All_Planets.avi
2287920 Destroy_All_Planets.ts
2140308 Destroy_All_Planets.asf
2140308 Destroy_All_Planets.wmv
2106300 Destroy_All_Planets.mpeg
2103940 Destroy_All_Planets.mkv
2103404 Destroy_All_Planets.mov
2103404 Destroy_All_Planets.mp4
0 Destroy_All_Planets.3g2
0 Destroy_All_Planets.3gp
0 Destroy_All_Planets.flv
0 Destroy_All_Planets.mxf
0 Destroy_All_Planets.ogg
0 Destroy_All_Planets.webm
In the interests of full disclosure it should be noted that in this case conversion to mkv also failed and I got the error Can't write packet with unknown timestamp
I resolved this problem before on other files by adding -fflags +genpts
before the input file which is the workaround outlined here. In this instance it resulted in a playable file which no player I tried was able to determine the duration of. Converting the previously converted mp4 to mkv worked fine in this instance. Another test resulted in the following results:
3129112 disorder_in_the_court.avi
623632 disorder_in_the_court.ts
583424 disorder_in_the_court.mpeg
575288 disorder_in_the_court.mov
575288 disorder_in_the_court.mp4
575224 disorder_in_the_court.mkv
The previous test included an mpeg with subtitles, this one did not have embedded subtitles and the Matroska container came out with the smallest file size. It also has the benefit of being the most flexible of the containers tested allowing for virtually any video, audio, or subtitle format currently available.