Change Video Codec – How To Edit Videos Via API

Converting all kinds of video files to other video formats is a strong suit of Online-Convert.com and our API. Likewise, converting music and other audio files to video and vice versa is possible as well. But we can do more!

With the help of the API you are now able to edit your video files when it comes to different video and audio codecs! Using a free tool called Postman (which is available as a downloadable program or as an app for your Google Chrome browser), you can now change different codecs in your video files. To do so and use Postman, you don’t have to be a developer. We have created a tutorial for you on how to use Postman to test our API. Once you get the hang of it, you can start editing video files!

 

How To Change Codecs For Video Files

Assuming that you learned how to send basic requests to Postman, all you need to do is change the code you send. In the options of your request, you can add the codec you wish to change. Following, we will show you how to do this for both video and audio codecs.

 

Change Video Codec

When sending your POST request, the video codecs you want to change can be specified in the options. This means the following snipped should be part of the “conversion” part of your code.

"options": {
        "codec": "h.264"
      }

 

For example, the code for a whole conversion, including input file, would look like this:

{
    "input": [{
      "type": "remote",
      "source": "http://cdn.online-convert.com/example-file/video/mp4/example_small.mp4"
    }],
    "conversion": [{
      "category": "video",
      "target": "mp4",
      "options": {
        "codec": "mpeg1video"
      }
    }]
}

 

There are several video codecs supported by our API, depending on the video format you are converting to. The whole list contains the following codecs:

  • dx50
  • h.263
  • h.264
  • h.265
  • huffyuv
  • mjpeg
  • mpeg1video
  • mpeg2video
  • mpeg4
  • msmpeg
  • screen_video
  • screen_video_2
  • sorenson
  • theora
  • vp8
  • vp9
  • wmv7
  • wmv8
  • xvid

 

However, not all codecs are supported by all video formats you can convert to. But there are two ways to find out which codecs are actually supported by the file you need.

  1. Check this list here: https://api2.online-convert.com/conversions?page=2
    Simply search for the format you want to convert to and check the list of codecs.
  2. Check a format directly using this link: https://api2.online-convert.com/conversions?target=avi
    In the URL, simply replace the format extension (here “avi”) with the extension you want to check

 

Change Audio Codec

Changing the audio codec of a video is just as easy as changing the video codec. It is also done using the options of a “conversion” request, just using another command:

"options": {
        "audio_codec": "flac"
      }

 

A full command to change the audio codec of a video file would look like this:

{
    "input": [{
      "type": "remote",
      "source": "http://cdn.online-convert.com/example-file/video/mp4/example_small.mp4"
    }],
    "conversion": [{
      "category": "video",
      "target": "mp4",
      "options": {
        "audio_codec": "mp3"
      }
    }]
}

 

There are several audio codecs you can choose from when converting to video. The full list is the following:

  • acc
  • adpcm
  • adpcm_ms
  • amr-nb
  • asao
  • flac
  • mp2
  • mp3
  • opus
  • pcm_s16_be
  • pcm_s16_le
  • pcm_u8
  • speex
  • vorbis
  • wmav1
  • wmav2

 

For specific audio codecs able to choose for certain video files, check the two links from above. They are all listed there as well.

 

Change Audio & Video Codec At Once

Last but not least, lets have a look at what our code would look like to change both the video and audio codec at the same time.

{
    "input": [{
      "type": "remote",
      "source": "http://cdn.online-convert.com/example-file/video/avi/example_small.avi"
    }],
    "conversion": [{
      "category": "video",
      "target": "avi",
      "options": {
        "codec": "mpeg4",
        "audio_codec": "aac"
      }
    }]
}

Want to get in touch with us? Hit us up on our social media channels!

NEW Feature: Change Video Codec

Change Video Codec

In an earlier article, we have already touched on the topic of video codecs. In short, these codecs determine the compression of a video file and which players are able to play your video. This is the reason why some media players on your computer or even hardware players may not be able to play a movie or clip you downloaded. The codecs must be supported by the respective player in order to do so.

Thus, if a video works without a problem on your computer but can’t be watch on your TV, the codec may be the problem. Online-Convert.com has you covered for that. You can now change the codec of your video file!

 

Change The Video Codec Of Your File

Playing with the video codec of your file can be a delicate task. Thus, make sure to always preserve the original file until you know the converted file works as you want it to. A bit of trial and error may be needed. Alternatively, you can always read up on which codecs are supported by your hardware device or media player and choose a codec from the (hopefully) given list.

Luckily, changing the codec is rather easy. You simply have to choose it from a dropdown list given when you convert your file to MP4, MOV, 3GP or any other video format on online-convert.com.

 

Depending on the output format, you will have some of the following codecs available:

  • dx50
  • h.263
  • h.264
  • h.265
  • huffyuv
  • mjpeg
  • mpeg1video
  • mpeg2video
  • mpeg4
  • msmpeg
  • screen_video
  • screen_video_2
  • sorenson
  • theora
  • vp8
  • vp9
  • wmv7
  • wmv8
  • xvid

 

Changing The Audio Codec

Video files contain many different media streams. Next to the video data, there is also audio data stored in the file (sometimes even subtitles and different audio data for different languages as well). Especially when a video plays without the audio being audible, it may be that the issue lies within the audio codec of the audio stream.

Thus, you are also able to change the audio codec used in your video file! For a complete list of codecs available and more information about audio codecs in general, check out this article.


Want to get in touch with us? Hit us up on our social media channels!

NEW Feature: Change Audio Codec

Change Audio Codec

There is more to audio files than just an icon to click on and an audio stream to listen to. When going a bit more in depth when it comes to audio files and audio file conversion, you have surely heard about different audio codecs. It is, among other things, responsible for the compression of audio data and determines which players and other hardware devices can play the file. For example, many media players have a huge list of supported codecs, but offer additional codec patches to be installed if one of your files does not play.

If you have a piece of music or other audio file you can’t play, the codec might be the problem. Hence why we introduced a whole new feature to online-convert.com’s audio converters:

 

Change The Audio Codec Of Your File

If you do not know exactly which codec to use for a file to be playable on your device, a bit of trial and error is needed. You can always check the specifications for any hardware players or the list of codecs supported for media players and music player apps to be sure to find the audio codecs that work best for your purpose.

Not all audio converters provide the possibility to change the respective codec since they are widely supported or contain supported codes already. However, if you choose certain audio converters, you can still choose to change the codec. The following codecs are available for the respective conversions:

M4A Converter

  • alac (default)
  • aac

OGG Converter

  • vorbis (default)
  • speex
  • opus

WMA Converter

  • wma2 (default)
  • wma1

 

Of course there is also the possibility to change the audio codecs of video files. If you can not play a certain video on your smartphone or a movie won’t play on your computer after downloading, this may be one of the reasons. Likewise, it may happen that a video that worked on your computer has no audio when watching it on another device. Changing the audio codec of the video file may solve this issue.

for our video converters, we have the following codecs available, depending on the video file you want to convert to.

  • acc
  • adpcm
  • adpcm_ms
  • amr-nb
  • asao
  • flac
  • mp2
  • mp3
  • opus
  • pcm_s16_be
  • pcm_s16_le
  • pcm_u8
  • speex
  • vorbis
  • wmav1
  • wmav2

 

Impact on file size

As mentioned above, the audio codec is also responsible for the compression of an audio file. Thus, we have conducted an example to show you how choosing a different audio codec may impact the file size of your audio file.

For the test, we converted a FLAC file with a size of 2.54 MB. Let’s have a look what converting it to M4A, OGG and WMA did to the file size, respectively:

to M4A

  • alac = 2.55 MB
  • aac = 595 KB

to OGG

  • vorbis = 488 KB
  • speex = 141 KB
  • opus = 467 KB

to WMA

  • wma2 = 622 KB
  • wma1 = 622 KB

 

These examples show that converting using an audio codec different than alac (which roughly retained the file size of the original audio file), significantly reduces the size of the resulting audio file.


Want to get in touch with us? Hit us up on our social media channels!