The "unknown codec" message indicates that it cannot determine the codec used by the input file. Therefore, specify the input codec on the command line (rawvideo
in this case). To convert to 4:2:0 H.264:
ffmpeg -c:v rawvideo -i input.avi -c:v libx264 -pix_fmt yuv420p output.mp4