How record line in audio on iPhone with lightning jack? I've been tearing my hair out over this one: when recording audio or video with my iPhone, I can't figure out how to use the lightning port for an audio-in signal.

For example, I'm filming someone playing an instrument, and I want to use the audio-out of that instrument as the direct sound source for the video. (without holding a microphone near the speakers...)

I have tried a 3.5mm 4-pin minijack cable from the instrument to the iPhone (with the minijack to lightning converter) but this 4-pin audio cable is not recognised as a microphone/sound input. I have also read an article about soldering your own cable with the right resistor values, but that can't be the only way to record audio on an iPhone???

The only microphone that gets recognised is the one that is built in the official apple EarPods. 

How can I record an audio source directly into my iPhone?
You need a Lightning audio interface. There's a lot of different products in various price ranges from a number of makers. Note that there are some that are targetted at specific instruments such as guitar or bass, or microphones - and some have multiple types of inputs.

You could for example take a look at the Line 6 Sonic Port audio interface for Lightning or similar.

If you want something for 3.5mm minijack, you could instead look at the Tascam iXZ Microphone and Audio Interface for iOS (approx. 60$). 

Any assorted music store, or online vendors such as Amazon, has multiple types of these products. Some cheaper than the these, some much more expensive.