Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.


Go Back   Doom9's Forum > Announcements and Chat > General Discussion

Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 22nd February 2014, 11:03   #1  |  Link
Registered User
Join Date: Feb 2014
Posts: 6
M2TS, FFMPEG, Sony Vegas, and Me

I wasn't 100% sure where this should go, since it could technically fall under video capture, alternative A/V containers, MPEG4, and maybe Virtual Dub. So maybe I'm a big idiot, but I've been tearing my hair out about this for a week now; at the very least maybe somebody here could point me to another forum where I could get the answers I need. Regardless, this is going to be kind of a long post, so buckle in.


I bought a Roxio Gamecap HD Pro because it was the cheapest high-def capture device and it seems you get what you pay for.

The device records to Blu-ray style M2TS files. The primary issue is that I cannot edit these M2TS files in Sony Vegas; Vegas does not understand the flavor of AAC it is using. I have thrown these M2TS files at everything I can think of; Avidemux, tsmuxer, easyh264, VirtualDub, etc. Sometimes it will convert the files but take an impractical amount of time (4+ hours for a 15 minute clip), other times it will convert files quickly but Vegas still has trouble. Roxio's official solution is to use their sluggish, bloated Videowave software to convert to MP4, but that gives me no control over bitrate and produces sub-par results.

I decided to turn to FFMPEG, because FFMPEG can handle anything. Unfortunately, either FFMPEG cannot handle these files, or I am using FFMPEG wrong.
  • Attempted Solution #1
ffmpeg.exe -i %1 -c:v mjpeg -b:v 60000k -c:a pcm_s16le  %1_COPY.avi
Simple. Convert the video to the two most basic codecs imaginable. Short test encodes imported in to Sony Vegas just fine, full-video encodes create a curious problem where Vegas sees the audio track, but only thinks it is three seconds long. As it turns out, if FFMPEG has to convert one of these M2TS files, any video over 2 minutes and 46 seconds long generates this shortened audio problem. I have no idea why. The files themselves play back fine in Media Player Classic, the issue is just in Sony Vegas.
  • Attempted Solution #2
ffmpeg.exe -ss 00:02:46.000 -i %1 -to 00:02:44.000 -c:v mjpeg -b:v 60000k -c:a pcm_s16le %1_COPY.avi
With the above in mind, maybe you could just seek past the problem and just make a bunch of 2:45 clips and stitch them together after the fact, right? Nope. As far as I can tell, anything past the 2:46 mark has this problem.
  • Attempted Solution #3
ffmpeg.exe -i %1 -c:a pcm_s16le %1_COPY.wav
ffmpeg.exe -i %1 -i %1_COPY.wav -shortest -map 0:0 -map 1:0 -c:v mjpeg -b:v 60000k %1_COPY.avi
Extract the audio, convert it to PCM, re-add it to the video. Generates the 3-second-long-audio-track issue in Sony Vegas.
  • Attempted Solution #4
ffmpeg.exe -i %1 -c:a pcm_s16le %1_COPY.wav
ffmpeg.exe -i %1 -c:v mjpeg -b:v 60000k -an %1_COPY.avi
ffmpeg.exe -i %1_COPY.avi -i %1_COPY.wav -shortest -map 0:0 -map 1:0 -c:v copy %1_FINAL.avi
Extract the audio, convert it to PCM. Remove the audio from the video, recompress to MJPEG. Combine separated audio and video files in to final product. Generates the 3-second-long-audio-track issue in Sony Vegas.
  • So Far The Only Working Solution

ffmpeg.exe -i %1 -c:a pcm_s16le %1_COPY.wav
ffmpeg.exe -i %1 -c:v mjpeg -b:v 60000k -an %1_COPY.avi
Extract audio and video separately, recombine them in VirtualDub. Tedious as hell, especially if I'm capturing footage for something large-scale. And I can't just convert the M2TS file in VirtualDub alone, either, as that generally seems to cause VirtualDub to crash.

If you need the full console output from FFMPEG, here's one such:

C:\Documents and Settings\Ryan>"F:\fraps\Roxio\ffmpeg.exe" -i F:\fraps\Roxio\2-1
7-2014_10.m2ts -c:v mjpeg -b:v 60000k -c:a pcm_s16le  F:\fraps\Roxio\2-17-2014_1
ffmpeg version N-60572-gccc48b3 Copyright (c) 2000-2014 the FFmpeg developers
  built on Feb 12 2014 22:01:44 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aa
cenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavp
ack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 63.101 / 52. 63.101
  libavcodec     55. 52.101 / 55. 52.101
  libavformat    55. 32.100 / 55. 32.100
  libavdevice    55.  9.100 / 55.  9.100
  libavfilter     4.  1.102 /  4.  1.102
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
[mpegts @ 02a5a960] PES packet size mismatch
Input #0, mpegts, from 'F:\fraps\Roxio\2-17-2014_10.m2ts':
  Duration: 00:04:34.76, start: 1.200000, bitrate: 12179 kb/s
  Program 1
    Stream #0:0[0x1011]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p, 1
280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0:1[0x10f]: Audio: aac ([15][0][0][0] / 0x000F), 48000 Hz, stereo, f
ltp, 9 kb/s
[swscaler @ 02b46ca0] deprecated pixel format used, make sure you did set range
Output #0, avi, to 'F:\fraps\Roxio\2-17-2014_10.m2ts_COPY.avi':
    ISFT            : Lavf55.32.100
    Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj420p, 1280x720 [SAR 1:1 D
AR 16:9], q=2-31, 60000 kb/s, 59.94 tbn, 59.94 tbc
    Stream #0:1: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 48000 Hz, stereo, s16
, 1536 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (h264 -> mjpeg)
  Stream #0:1 -> #0:1 (aac -> pcm_s16le)
Press [q] to stop, [?] for help
And as its finishing encoding, it barfs up this:

[mpegts @ 02a5a960] PES packet size mismatch
[h264 @ 02c85400] error while decoding MB 20 9, bytestream (-6)
[aac @ 02a5eb00] Input buffer exhausted before END element found
Error while decoding stream #0:1: Invalid data found when processing input
[h264 @ 02c85400] concealing 2909 DC, 2909 AC, 2909 MV errors in B frame
video:2010209kB audio:51344kB subtitle:0 data:0 global headers:0kB muxing overhe
ad 0.034985%
I've posted about this on the FFMPEG forums (see here) but as of yet nobody there has gotten back to me with a solution, and it's been more than a week. I uploaded 1.2gb example file if anyone needs something to play around with. It's split in to three parts:

https://www.dropbox.com/s/5g15ahhu4968m1r/2-11-2014_04.7z.001 (499mb)
https://www.dropbox.com/s/j1msqzf2fi2w3a4/2-11-2014_04.7z.002 (499mb)
https://www.dropbox.com/s/hx0140kafjefifq/2-11-2014_04.7z.003 (153mb)

If that's too big, I can try to upload something a little smaller, instead.

I have my fingers crossed that somebody here can help me out. The Roxio was "cheap", but it was still $120 out of my pocket.

Last edited by TheLostSkeleton; 22nd February 2014 at 12:17.
TheLostSkeleton is offline   Reply With Quote

aac, ffmpeg, gamecap, m2ts, roxio

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 10:38.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.