Convert MOV Video File Encoded as `qtrle` in Windows Using FFMPEG

0

I downloaded the latest FFMPEG for Windows (Version 3.2.4).

I wanted to use it for converting a MOV File which contains qtrle uncompressed video.

The video can be downloaded on this link - https://www.sendspace.com/file/qjjkhj.

I can view the video in VLC Media Player yet when I try convert it in VLC into any video format the output is invalid video file.

I also tried using FFMPEG using the following command - ffmpeg -i DL126H.mov -c:v copy VideoClip0002.mp4. Yet the result was: [mp4 @ 00000000026744e0] Could not find tag for codecqtrlein stream #0, codec not currently supported in container Could not write header for output file #0 (incorrect codec parameters ?): Invalid argumentStream mapping:.

I also tried the following - ffmpeg -i DL126H.mov -c:v mpeg2video -b 16M out.mpg yet the output, just like in the case of VLC was invalid video file.

So I'd like the assistance with:

  1. Convert into Windows friendly format (With High Quality)?
  2. Change container into format working in Windows (With no rencoding).
  3. Convert into valid MPEG2 (.mpg) with high bit rate.

Thank You.

Royi

Posted 2017-03-14T11:54:39.453

Reputation: 276

what does "invalid video file" look like/say? – rogerdpack – 2019-12-28T07:09:44.493

Answers

3

The syntax is simply

ffmpeg -i DL126H.mov -pix_fmt yuv420p VideoClip0002.mp4

This will encode using default parameters i.e. using libx264 at CRF 23 and AAC at 128 kbps.

To use custom parameters, like better video quality, use

ffmpeg -i DL126H.mov -crf 18 -pix_fmt yuv420p VideoClip0002.mp4

This will preserve more of the source quality but a larger file

In FFmpeg's case, the 'release' build is never the latest version. Always go for the nightly/snapshot/git build.


If you want to encode to MPEG-2, use

ffmpeg -i DL126H.mov -c:v mpeg2video -b:v 16M -bufsize 30M -maxrate 30M -pix_fmt yuv420p VideoClip0002.mp4

The MPEG-2 spec was designed during SD video days and its defaults are not suitable for HD video. So a couple of them have to be manually overridden. The result plays for me in WMP12.

Gyan

Posted 2017-03-14T11:54:39.453

Reputation: 21 016

Could you explain what you did? What if I want to encode as MPEG2? What about just changing the container into MP4? – Royi – 2017-03-14T12:16:57.867

1FFmpeg does not support writing qtrle into MP4 so that's not possible. My first command (of the form ffmpeg -i input output) converts input into output using default choice of codecs and their conversion parameters. I've added -pix_fmt yuv420p as that's the only pixel format supported by web players, and qtrle is RGB for which ffmpeg will default to yuv444p for output. Playable in some players only. To encode to MPEG-2, use your command but add the pix_fmt. – Gyan – 2017-03-14T12:24:14.973

I tried the pix_fmt with my command and the output video is invalid (MPEG2). Maybe MPEG2 requires different Pixel Format? What's the default Pixel Format for MPEG2? Thank You. – Royi – 2017-03-14T12:28:22.007

The same. See answer edit. – Gyan – 2017-03-14T12:44:29.697

I tried your new command line. It really managed to remove the Buffer Under run issues of ffmpeg. Thank You! By the way, how can I make FFMPEG use only the first n frames? – Royi – 2017-03-14T12:57:24.263

Add -vframes n – Gyan – 2017-03-14T12:58:50.797

OK, Found something which is still an issue there. We set Constant Bit Rate (At least that what I'm trying to do) of ~16Mbits. Yet the output size is only 1MB. Media Info shows the Bit Rate is Variable. How can I create Constant Bit Rate? – Royi – 2017-03-14T13:01:11.153

Usual method is to add minrate same as bufsize and maxrate and b:v. But encoders don't like to waste bytes, so the usual method is to pad the encoder output so that desired rate is reached. This only works if realized encoded bitrate is lower than desired CBR. Why do you need CBR? And why MPEG-2? – Gyan – 2017-03-14T14:01:19.537

Just for simplicity of things an compatibility with another program. I saw the method you mentioned, will it really create a CBR Video? Namely in Media Info will the Bit Rate property be Constant? Thank You. – Royi – 2017-03-14T14:41:06.537

@Royi As Mulvya said, a "real" CBR video will be hard to achieve. In MPEG-2 (and other video coding standards), there is no concept of VBR or CBR. It's a decision of the encoder how to spend its bits. Unlike what you may get for, say, AAC or MP3, where VBR/CBR are intrinsic concepts of the standard, this will never get reported anywhere (e.g. MediaInfo). More generally, "perfect CBR" is rarely used in video encoding; it'll either waste bits or compromise quality. Why do you need MediaInfo to tell you that? – slhck – 2017-03-14T15:14:50.997