Apparatus with variable compression ratio and variable expansion ratio for an internal combustion engine, mounted on the engine crankshaft and the assembly of the piston-connecting rod, comprising an actuating motor, a worm, a worm gear, a sun gear, a first transmission shaft, a plurality of the transmission shafts, a first eccentric sleeve, a plurality of eccentric sleeve, a front gear of the first eccentric sleeve, a plurality of the front gear of the eccentric sleeve, a plurality of the rear gear of the eccentric sleeve, a planetary gear, the rear gear of the first transmission shaft, a plurality of the front gear of the transmission shaft, and a plurality of the rear gear of the transmission shaft. An angle α between the axis of the first transmission shaft and the axis of the crankshaft is not zero, the other axes of the transmission shafts with the axis of the crankshaft coincide, or parallel but do not coincide, or form a non zero angle.