In the United States I would like to know if it is legal to use propriety video and audio codecs in Ubuntu. Specifically I would like to know if I can play mp3 files on Ubuntu, and if I can install and use the libx264 library to do video editing and export mp4 files.

I went to Computex in Taiwan today and I went to the Ubuntu booth. A person there told me that Canonical has paid for the right/license to use proprietary audio and video formats/codecs. Is this true? I asked the person if he could show me anything online that said this and he could not find anything. Is there any list of codecs/formats that can be used legally in the United States for the purpose of listening to audio, watching video and audio and video editing?

I want to use OpenShot to edit some video and export it to mp4 using libx264 but I want to do it legally.

I'm not a legal advisor. But even if Canonical has paid for the right/license to use proprietary audio and video formats/codecs, You can edit your own stuff legally, and without any problems. But if you are editing other person's work, to that is illegal in any country. But what do I know, as I said I`m not a legal advisor.

Selling/distribution of MP3 codec binaries is illegal because they are bound by patents, mainly by the Fraunhofer Society.
For libre use, there are open source implementations of the standard ( iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=31537 ) and it is NOT illegal to distribute their source code. There is:

LAME for encoding (http://lame.sourceforge.net/)

MAD for decoding (http://www.underbit.com/products/mad)

Mpadec for decoding (http://sourceforge.net/projects/mpadec/)

and probably even more.

For more information:

en.wikipedia.org/wiki/MP3#Licensing_and_patent_issues

en.wikipedia.org/wiki/List_of_open_source_codecs

Concerning Canonical, they can't provide codecs with their installation media, as this would be considered as reselling patented software, that's why they provide such functionality via their ubuntu store: