8

I would like to convert an MPEG TS file to MP4. Is there software for Ubuntu that I can buy that just works?

In 13.10 I did the following with success: Edit the file with DVB-CUT and export to MPG. Then open the MPG in WinFF, select MP4 with High Quality preset and convert but in 14.04 this fails with the following error:

avconv version 9.11-6:9.11-2ubuntu2, Copyright (c) 2000-2013 the Libav developers
  built on Mar 24 2014 06:12:33 with gcc 4.8 (Ubuntu 4.8.2-17ubuntu1)
[mpeg @ 0x16f4d40] max_analyze_duration reached
Guessed Channel Layout for  Input Stream #0.1 : stereo
Guessed Channel Layout for  Input Stream #0.2 : mono
Input #0, mpeg, from '/home/magnus/Desktop/Car Rescue.mpg':
  Duration: 00:44:28.33, start: 0.245800, bitrate: 2352 kb/s
    Stream #0.0[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [PAR 64:45 DAR 16:9], 9500 kb/s, 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16p, 192 kb/s
    Stream #0.2[0x1c1]: Audio: mp2, 48000 Hz, mono, s16p, 64 kb/s
Unknown encoder 'libvo_aacenc

Press Enter to Continue
4
  • Take a look at HandBrake.
    – Mitch
    Apr 15, 2014 at 7:22
  • Thanks, I was just about to try Handbrake which I have used before but find a bit complicated when I tried the VLC method described below.
    – user104140
    Apr 15, 2014 at 7:47
  • I spent some hours reading various solutions in myriad places so it is difficult to say exactly what I did to get it working but typing the following in to the terminal works (where one.mpg in my home folder is the file to be converted) and it works on iDevices too:
    – user104140
    Jun 11, 2014 at 9:51
  • 1
    /usr/bin/avconv -y -i "/home/magnus/one.mpg" -f mp4 -r 29.97 -vcodec libx264 -preset slow -filter:v scale=704:384 -b:v 1000k -aspect 16:9 -flags +loop -cmp chroma -b:v 1250k -maxrate 1500k -bufsize 4M -bt 256k -refs 1 -bf 3 -coder 1 -me_method umh -me_range 16 -subq 7 -partitions +parti4x4+parti8x8+partp8x8+partb8x8 -g 250 -keyint_min 25 -level 30 -qmin 10 -qmax 51 -qcomp 0.6 -trellis 2 -sc_threshold 40 -i_qfactor 0.71 -acodec aac -strict experimental -b:a 112k -ar 48000 -ac 2 "/home/magnus/one.mp4"
    – user104140
    Jun 11, 2014 at 9:51

2 Answers 2

14

You could use VLC to convert mpeg files to mp4. To do this:

  • Open VLC

  • Click on Media in the menu bar and select "Convert / Save"

  • In the "File" tab, click on "Add..." button and choose the file to convert from the file browser dialog box that opens up

  • Click on "Convert / Save" and verify that the source file is exactly the one which you want to convert and give an appropriate file name for the destination file, appended with ".mp4" and choose the format for the destination file. In your case this would be "Video - H.264 + MP3 (MP4)" and then click on "Start"

This may take some time depending upon the length of the file and when it finishes, voila! You have your file ready.

4
  • 1
    Worked exactly as per your instructions. Thank you!
    – user104140
    Apr 15, 2014 at 7:44
  • While this did work, the resulting mp4 file didn't play correctly on an iPad.
    – user104140
    Jun 11, 2014 at 9:46
  • @user104140: Are you sure you played the same file, without reconversion to any other format? And yes, what exactly happened when you played it on iPad(any error message)?
    – jobin
    Jun 11, 2014 at 13:10
  • Yes via FileExplorer over wifi and also transfered with iTunes. The video stutters and there is no sound. I used this profile: "Video - H.264 + MP3 (MP4)". I can provide a short clip if wanted ~10MB.
    – user104140
    Jun 12, 2014 at 7:34
5

Your copy of avconv is missing the encoder libvo_aacenc which you can restore by simply installing the extra libavcodec package:

sudo apt-get install libavcodec-extra-54

This should allow WinFF to convert to aac again!

Mind you the better aac codec is libfdk-aac but I believe this is not available in the 14.04 avconv / libav-tools...

1
  • 1
    Doesn't this cause problems in removing libavcodec54?
    – user104140
    Jun 11, 2014 at 9:48

You must log in to answer this question.