I have a problem I am working on that can be reduced to the following case of edge coloring with a special condition.

Let $G$ be a directed graph with infinite vertices that are colored with $m$ colors $\{1,2,...,m\}$, now I want to color edges (with respect to coloring of vertices) in a way that all input edges of every vertex don't have a same color (i.e. For each vertex there exist at least two input edges with different colors). Colors of edges can be different from colors of vertices. Assume that each vertex has more than $2$ inputs.

In other words, I am looking for a spanning subgraph of the initial graph that has two inputs of different colors and at most one output. How can we do this edge coloring? Are there some conditions to guarantee what we want?

Has anyone seen this problem before? Are there any results? Would you recommend any references or perhaps additional directions to search.