Network lifetime maximization is a critical issue in wireless sensor networks since each sensor has a limited energy supply. Different from conventional sensors, video sensors compress the captured video before transmission. The encoding processing demands high power consumption, thus raises challenges to maintain a long network lifetime. In this paper, we formulate the network lifetime maximization problem in wireless visual sensor networks, and propose a fully distributed algorithm to solve this problem. The proposed algorithm maximizes the network lifetime by jointly optimizing the encoding power, the source rate, and the link rate. Our experimental results show the effectiveness and efficiency of the proposed algorithm.