Muxing M2V and PCM WAV to an MPEG Transport Stream: crash

990 views
Skip to first unread message

cmbrougham

unread,
Jul 8, 2011, 11:06:10 AM7/8/11
to ffmbc-discuss
Hello,

I'm not too versed in FFmbc/FFmpeg, but am starting to get the hang of
a few things. One issue I've run into is when trying to rewrap Apple
HDV MOVs as MPEG transport streams, so that they can be used on a
Windows machine (Premiere Pro). I'm able to demux the MOVs into M2V
and WAV streams, both of which import fine into Premiere Pro, but so
far, I've not been able to use FFmbc to mux those back into an MTS/
M2TS file. Sometimes, FFmbc just hangs, forcing me to kill it off, or
sometimes it simply crashes.

I've used tsMuxeR to put the M2V and WAV together into an M2TS, and
the resulting file imports and plays perfectly in Premiere Pro, so I
know this can be done. I'd like to come up with a single program
solution, so I'm hoping it's something that simply needs to be added
to the FFmbc command line to enable this.

I've tried searching a kajillion different ways on MTS muxing with
FFmpeg/FFmbc, and haven't found much--at least not much that I'm able
to process. Is this possible with FFmbc, and if so, how can I go about
it?

Thanks in advance...

Baptiste Coudurier

unread,
Jul 8, 2011, 11:12:58 AM7/8/11
to ffmbc-...@googlegroups.com
Hi,

On 07/08/2011 08:06 AM, cmbrougham wrote:
> Hello,
>
> I'm not too versed in FFmbc/FFmpeg, but am starting to get the hang of
> a few things. One issue I've run into is when trying to rewrap Apple
> HDV MOVs as MPEG transport streams, so that they can be used on a
> Windows machine (Premiere Pro). I'm able to demux the MOVs into M2V
> and WAV streams, both of which import fine into Premiere Pro, but so
> far, I've not been able to use FFmbc to mux those back into an MTS/
> M2TS file. Sometimes, FFmbc just hangs, forcing me to kill it off, or
> sometimes it simply crashes.

Could you please share your input file and give the commandline you are
using ?
What you describe is not normal and must be fixed.

--
Baptiste COUDURIER
Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer http://www.ffmpeg.org

cmbrougham

unread,
Jul 8, 2011, 11:37:56 AM7/8/11
to ffmbc-discuss
Hi Baptiste,

Thanks for the reply, and fantastic software, by the way.

I'm uploading a sample clip right now, but here's a MediaInfo report
in the meantime:

General
Complete name : E:\_COMMON_\Test Projects\Scripts
\AppleHDV.mov
Format : QuickTime
Format/Info : Original Apple specifications
File size : 48.9 MiB
Duration : 14s 815ms
Overall bit rate : 27.7 Mbps
Writing library : Apple QuickTime
©TSC : 5994
©TSZ : 100

Video
ID : 1
Format : hdv9
Codec ID : hdv9
Duration : 14s 815ms
Bit rate : 18.3 Mbps
Width : 1 248 pixels
Original width : 1 280 pixels
Height : 702 pixels
Original height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 59.940 fps
Scan type : Progressive
Bits/(Pixel*Frame) : 0.348
Stream size : 32.3 MiB (66%)
Language : English

Audio
ID : 2
Format : PCM
Format settings, Endianness : Big
Format settings, Sign : Signed
Codec ID : twos
Duration : 14s 815ms
Bit rate mode : Constant
Bit rate : 1 536 Kbps
Channel(s) : 2 channels
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Stream size : 2.71 MiB (6%)
Language : English
Material_Duration : 14814
Material_StreamSize : 2844348

Menu
ID : 3
Duration : 14s 815ms
Language : English
Stream size : 4

The Apple HDV stuff is just regular HDV, only packaged in a QuickTime
MOV container. There are various FourCCs depending on what HDV flavor
it is, e.g. hdv1, hdv3, etc. All flavors seem to suffer the same fate.

If I try and copy the streams into an MTS, this is what I use:

ffmbc -i filename.mov -vcodec copy -acodec pcm_s16le -f mpegts -y
filename.mts

That will actually create an MTS file with the video stream, but no
audio; FFmbc crashes with this Windows error:

Problem Event Name: APPCRASH
Application Name: ffmbc.exe
Application Version: 0.0.0.0
Application Timestamp: 4ce9ddac
Fault Module Name: ffmbc.exe
Fault Module Version: 0.0.0.0
Fault Module Timestamp: 4ce9ddac
Exception Code: c0000005
Exception Offset: 004f45ee
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

If I set "-acodec copy" then FFmbc simply crashes and doesn't really
write anything.

If I extract the video separately to an M2V file (-f mpegvideo) and
the audio separately to a WAV file (-acodec pcm_s16le -f wav), the
streams are usable, but FFmbc won't mux them; tsMuxeR will, however,
and the file plays back and maintains perfect sync.

Here's a link to the MOV mentioned above: http://www.mediafire.com/?xm7lcsc1lc36slc

Thanks for looking into it, and please let me know if you need any
other information. This may just be operator error!

cmbrougham

unread,
Jul 8, 2011, 11:40:15 AM7/8/11
to ffmbc-discuss
Oh, and I should mention that I'm using 0.5 that I downloaded before
it disappeared. Maybe this is fixed in 0.6? I can't test as I'm just a
dumb Windows user and don't know how to compile things :P

I should mention--if it makes any difference--that using a recent
build of FFmpeg results in the same crash.

cmbro...@gmail.com

unread,
Jul 8, 2011, 3:28:51 PM7/8/11
to ffmbc-...@googlegroups.com
A little bit more info:

No matter what PCM format I try to convert the audio to, the resulting MTS doesn't contain it, and FFmbc crashes. However, if I use "-acodec ac3 #parameters#" the audio is transcoded and muxing completes successfully; the resulting MTS contains AC3 audio.

Not sure if that gives you any more direction, but it appears that muxing is OK; just that PCM audio falls down.

thanks.

Baptiste Coudurier

unread,
Jul 8, 2011, 4:51:58 PM7/8/11
to ffmbc-...@googlegroups.com
Hey,

Indeed, thanks for the bug report. The crash will be fixed soon.
However, I'm sorry but muxing PCM audio in TS is not currently supported.

cmbro...@gmail.com

unread,
Jul 11, 2011, 9:00:48 AM7/11/11
to ffmbc-...@googlegroups.com
Hi,

Glad it's a bug that can be squashed. Just so I'm clear: the bug you're referring to is with the muxing, and not with the PCM support in the TS file, correct? If that's the case, please consider PCM/TS support as a much-desired capability of FFmbc; lots of folks switching from FCP7 to Premiere Pro (and sometimes from Mac to Windows) would appreciate the ability to use their QuickTime-wrapped assets. As mentioned, I've got a workaround with tsMuxeR, but a single-source solution would be excellent.

Thanks again for the great tool, and I'm looking forward to future enhancements.

Baptiste Coudurier

unread,
Jul 11, 2011, 11:14:07 AM7/11/11
to ffmbc-...@googlegroups.com
Hi,

On 07/11/2011 06:00 AM, cmbro...@gmail.com wrote:
> Hi,
>
> Glad it's a bug that can be squashed. Just so I'm clear: the bug you're
> referring to is with the muxing, and not with the PCM support in the TS
> file, correct? If that's the case, please consider PCM/TS support as a
> much-desired capability of FFmbc; lots of folks switching from FCP7 to
> Premiere Pro (and sometimes from Mac to Windows) would appreciate the
> ability to use their QuickTime-wrapped assets. As mentioned, I've got a
> workaround with tsMuxeR, but a single-source solution would be excellent.

I'm surprised TS format is the primary choice with Premiere Pro.
This seems awkward.

cmbro...@gmail.com

unread,
Jul 11, 2011, 1:17:29 PM7/11/11
to ffmbc-...@googlegroups.com
Well, I wouldn't say that it's the primary choice--it's not even preferred. I'm speaking to one pretty specific case here, and that's HDV that is captured by FCP using the Apple HDV codec (really, it's just MPEG2 in a QuickTime MOV). The data stream is the same as it was on the HDV tape, but unless you have FCP installed on a Mac or a third-party decoder installed ($$$), you can't use these clips.

Premiere Pro captures HDV to (I believe) M2TS files; it can import (not capture) TS, MTS, and M2TS files. I've tried putting the HDV stream into other containers supported by Premiere Pro--for example, MXF--but that doesn't work. Using QuickTime with the third-party decoder works, but it's not totally desirable since QT is locked to 32-bit, whereas Premiere Pro and its native importers (MPEG2 included) are 64-bit. Performance is great with the MTS files, given that. So unfortunately, while I agree that a TS is not the ideal way to deal with this, it works and works rather well. I don't know what other container format would be a viable alternative (unless you have suggestions), and the main goal is to avoid a transcode wherever possible. As mentioned above, I can use AC3 audio and successfully rewrap these, but that's not ideal.

And just to reiterate, I'm only talking about HDV here. For example, I've used FFmbc to rewrap XDCAM EX MOVs created by FCP during Log and Transfer into MXF files that import perfectly into Premiere Pro.

Anyway, I hope that makes sense. Thanks again for your input.

Baptiste Coudurier

unread,
Jul 11, 2011, 1:27:08 PM7/11/11
to ffmbc-...@googlegroups.com
On 07/11/2011 10:17 AM, cmbro...@gmail.com wrote:
> Well, I wouldn't say that it's the primary choice--it's not even preferred.
> I'm speaking to one pretty specific case here, and that's HDV that is
> captured by FCP using the Apple HDV codec (really, it's just MPEG2 in a
> QuickTime MOV). The data stream is the same as it was on the HDV tape, but
> unless you have FCP installed on a Mac or a third-party decoder installed
> ($$$), you can't use these clips.
>
> Premiere Pro captures HDV to (I believe) M2TS files; it can import (not
> capture) TS, MTS, and M2TS files. I've tried putting the HDV stream into
> other containers supported by Premiere Pro--for example, MXF--but that
> doesn't work. Using QuickTime with the third-party decoder works, but it's
> not totally desirable since QT is locked to 32-bit, whereas Premiere Pro and
> its native importers (MPEG2 included) are 64-bit. Performance is great with
> the MTS files, given that.

I think 32 vs 64 bit impact during import is minimal.

> So unfortunately, while I agree that a TS is not
> the ideal way to deal with this, it works and works rather well. I don't
> know what other container format would be a viable alternative (unless you
> have suggestions), and the main goal is to avoid a transcode wherever
> possible. As mentioned above, I can use AC3 audio and successfully rewrap
> these, but that's not ideal.
>
> And just to reiterate, I'm only talking about HDV here. For example, I've
> used FFmbc to rewrap XDCAM EX MOVs created by FCP during Log and Transfer
> into MXF files that import perfectly into Premiere Pro.

Did you try wrapping HDV mpeg-2 in MXF directly ?

cmbro...@gmail.com

unread,
Jul 11, 2011, 1:50:24 PM7/11/11
to ffmbc-...@googlegroups.com

Did you try wrapping HDV mpeg-2 in MXF directly ?

Just tried this on an M2T as captured by HDVsplit (Premiere Pro's HDV capture has... issues...). The MediaInfo report says:


General
ID                               : 255 (0xFF)
Complete name                    : E:\_COMMON_\Test Projects\Scripts\HDVCapture.m2t
Format                           : MPEG-TS
Format_Commercial_IfAny          : HDV 1080i
File size                        : 22.3 MiB
Duration                         : 7s 407ms
Start time                       : UTC 2009-02-10 12:41:40
End time                         : UTC 2009-02-10 12:41:47
Overall bit rate                 : 25.2 Mbps
Maximum Overall bit rate         : 33.0 Mbps
Encoded date                     : UTC 2009-02-10 12:41:40

Video
ID                               : 2064 (0x810)
Menu ID                          : 100 (0x64)
Format                           : MPEG Video
Format_Commercial_IfAny          : HDV 1080i
Format version                   : Version 2
Format profile                   : Main@High 1440
Format settings, BVOP            : Yes
Format settings, Matrix          : Custom
Format settings, GOP             : M=3, N=15
Codec ID                         : 2
Duration                         : 7s 40ms
Bit rate                         : 23.6 Mbps
Maximum bit rate                 : 25.0 Mbps
Width                            : 1 440 pixels
Height                           : 1 080 pixels

Display aspect ratio             : 16:9
Frame rate                       : 29.970 fps
Standard                         : Component
Color space                      : YUV
Chroma subsampling               : 4:2:0
Bit depth                        : 8 bits
Scan type                        : Interlaced
Scan order                       : Top Field First
Compression mode                 : Lossy
Bits/(Pixel*Frame)               : 0.506
Stream size                      : 19.8 MiB (89%)

Audio
ID                               : 2068 (0x814)
Menu ID                          : 100 (0x64)
Format                           : MPEG Audio
Format version                   : Version 1
Format profile                   : Layer 2
Codec ID                         : 3
Duration                         : 7s 104ms
Bit rate mode                    : Constant
Bit rate                         : 384 Kbps

Channel(s)                       : 2 channels
Sampling rate                    : 48.0 KHz
Compression mode                 : Lossy
Delay relative to video          : -64ms
Stream size                      : 333 KiB (1%)

Running a simple video-only script like "ffmbc -i HDVCapture.m2t -vcodec copy -an -f mxf HDVCapture.mxf" seems like it wants to work, but gives this:

ffmbc -i HDVCapture.m2t -vcodec copy -an -f mxf HDVCapture.mxf
FFmpeg version FFmbc-0.5, Copyright (c) 2000-2010 the FFmpeg developers
  built on Nov 22 2010 01:04:07 with gcc 4.4.2
  configuration: --enable-gpl --enable-version3 --enable-libgsm --enable-pthread
s --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libmp3lame --
enable-libopenjpeg --enable-libschroedinger --enable-libopencore_amrwb --enable-
libopencore_amrnb --enable-libvpx --disable-decoder=libvpx --arch=x86 --enable-r
untime-cpudetect --enable-libxvid --enable-libx264 --extra-libs='-lx264 -lpthrea
d' --enable-librtmp --extra-libs='-lrtmp -lpolarssl -lws2_32 -lwinmm' --target-o
s=mingw32 --enable-avisynth --cross-prefix=i686-mingw32- --cc='ccache i686-mingw
32-gcc' --enable-memalign-hack
  libavutil     50.31. 0 / 50.31. 0
  libavcore      0. 9. 0 /  0. 9. 0
  libavcodec    52.91. 1 / 52.91. 1
  libavformat   52.78. 5 / 52.78. 5
  libavdevice   52. 2. 2 / 52. 2. 2
  libavfilter    1.47. 1 /  1.47. 1
  libswscale     0.12. 0 /  0.12. 0
Input #0, mpegts, from 'HDVCapture.m2t':
  Duration: 00:00:07.08, start: 2848.846000, bitrate: 26462 kb/s
  Program 100
    Stream #0.0[0x810](und): Video: mpeg2video, yuv420p, 1440x1080i tff [PAR 4:3
 DAR 16:9], tbc 2002/60000, 25000 kb/s, fps 29.970
    Stream #0.1[0x814](und): Audio: mp2, 48000 Hz, 2 channels, s16, 384 kb/s
    Stream #0.2[0x815](und): Data: 0x00a0
    Stream #0.3[0x811](und): Data: 0x00a1
Output #0, mxf, to 'HDVCapture.mxf':
  Metadata:
    encoder: FFmbc 0.5
    Stream #0.0(und): Video: mpeg2video, yuv420p, 1440x1080i tff [PAR 4:3 DAR 16
:9], tbc 1001/30000, q=2-31, 25000 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press [q] to stop encoding
[mpegts @ 01b0c090] timestamps generation failed, frame duration not set
[mxf @ 01b0efd0] could not get mpeg2 profile and level
av_interleaved_write_frame(): Operation not permitted

A zero-byte file is generated. Running a similar command on the MOV above gives:

[mxf @ 03ebcaf0] unsupported video frame rate 5994/1

So... I'm lost.

Baptiste Coudurier

unread,
Jul 11, 2011, 2:06:20 PM7/11/11
to ffmbc-...@googlegroups.com
On 07/11/2011 10:50 AM, cmbro...@gmail.com wrote:
>
>>
>> Did you try wrapping HDV mpeg-2 in MXF directly ?
>>
>
> [...]

Can you upload your file somewhere ?

cmbro...@gmail.com

unread,
Jul 11, 2011, 2:23:22 PM7/11/11
to ffmbc-...@googlegroups.com
Here you go (about 22MB): http://www.mediafire.com/?cxsk114wbu82u9j

That's the file reported above.

By the way, the issue of 32-bit vs. 64-bit doesn't really matter as far as import goes; however, with general handling of files, Premiere Pro is much snappier with files that are imported natively versus those that must use the 32-bit on-the-fly translator/bridge (QT files).

XDCAM EX of all different flavors (also long GOP MPEG2 of a higher bitrate) goes into the MXF just fine, but I can't figure out how to make HDV work in MXF.

Baptiste Coudurier

unread,
Jul 11, 2011, 3:02:44 PM7/11/11
to ffmbc-...@googlegroups.com
On 07/11/2011 11:23 AM, cmbro...@gmail.com wrote:
> Here you go (about 22MB): http://www.mediafire.com/?cxsk114wbu82u9j
>
> That's the file reported above.

Thanks.

> By the way, the issue of 32-bit vs. 64-bit doesn't really matter as far as
> import goes; however, with general handling of files, Premiere Pro is much
> snappier with files that are imported natively versus those that must use
> the 32-bit on-the-fly translator/bridge (QT files).

I suspect this has nothing to do with 32 vs 64 bits. It feels like it
has to do with native vs translator/bridge.

[...]

Reply all
Reply to author
Forward
0 new messages