This paper proposes a new method based on 1/4 pixel precision motion estimation of H.264. The mapping rule between the partitioned block matching position and the binary information are used to hiding data in P slice. The secret data is embedded in group of pictures,in order to guarantee the integrity of data transmission,the head and tail of the secret data embedded in P slice and the amount of the data are also embedded in I slice. For one group,comparing the data in I and P slice in decoder, if the data is same, the fact proved that the data has not been affected by packet loss. If the data is different, the missing area will be find by comparing data in I slice and P slice.In order to prevent data being tampered with,it is necessary to embedded data in video repeatedly. Comparing the repeat data in decoder, if the data is same, the fact proved that the data has not been tampered with. If the data is different, the tampered data will be find by comparing. Experimental results show that, this algorithm can guarantee the integrity of the transmitted data effectively.