A similar question came up before. I posted some of the same thing in my answer there.
Is it possible to lower the H.264 video quality and bitrate without
fully decoding and encoding it?
H.264 B and P macroblocks reference frames that have already been processed by the deblocking filter. The deblocking strength is adaptive to the QP. I'm not sure, but I think this would lead to problems if you just re-quantized the DCT coefficients. In any case, I think it would just be a speed-hack that gives worse quality than full decoding + encoding. And I'm not aware of any implementations.
Nobody's even implemented a bitstream filter to losslessly convert h.264 Baseline to CABAC. :( It has been talked about, though.
However, this paper does have an implementation that partially decodes h.264, modifies it (for data-hiding), and re-encodes it. IDK what software he started with for the implementation, but his code, if available and appropriately licensed, might be a good starting point for other bitstream filters.
What conversions are in general available for H.264 content? Is there
a tool for lossless conversions like jpegtran for JPEG?
jpegtran only works because each DCT coefficient block is completely independent of all others. Even h.264 I frames predict from other blocks within the same frame. (Intra prediction, as opposed to inter prediction in P and B macroblocks). Lossless rotation or flipping probably isn't possible.
(Although phone cameras for example can just indicate with metadata that the player should rotate the video on playback, if they are held vertically while recording video.)
ffmpeg has a bitstream filter for h.264 that does something about converting how the h.264 stream is stored, or maybe something about the headers? IDK, I haven't had to use it, or read up. From the docs:
ffmpeg -i h264.mp4 -c:v copy -bsf:v h264_mp4toannexb -an out.h264
This isn't anything like what you're asking, though.