Generating Composite Video

I got the same signal when I first tried it. The solution is don't use digitalwrite, you can only change one pin at a time using that function(so it takes some time to change once and then again so you get step). Just output directly to the port

e.g portb=00000011;

instead of calling digitalwrite() twice. Once I did that I got a clean signal without the steps as shown in your oscilloscope. Also make sure interrupts are disabled. Cheers. Maybe that will help.