This paper extends the notion of μ-bases to arbitrary univariate polynomial matrices and present an efficient algorithm to compute a μ-basis for a univariate polynomial matrix based on polynomial matrix factorization. Particularly, when applied to polynomial vectors, the algorithm computes a μ-basis of a rational space curve in arbitrary dimension. The authors perform theoretical complexity analysis in this situation and show that the computational complexity of the algorithm is O(dn4+d2n3), where n is the dimension of the polynomial vector and d is the maximum degree of the polynomials in the vector. In general, the algorithm is n times faster than Song and Goldman’s method, and is more efficient than Hoon Hong’s method when d is relatively large with respect to n. Especially, for computing μ-bases of planar rational curves, the algorithm is among the two fastest algorithms.