PDA

View Full Version : TMPEG Command line?


yevlar
12th October 2006, 12:54
Is there any way to use TMPEG encoding from a command line or script?

Or, is there currently any way of doing multiple-PC parallel encoding of MPEG-2 from AVS or AVI sources? DVD-RB only supports DVD sources. I need to distribute MPEG-2 encoding of AVIs at much higher than DVD bitrates (15-25 Mb/sec) across several machines.

Pookie
14th October 2006, 00:34
FFMPEG.EXE

Newest versions of ffmpeg allow for direct .AVS input, multiple threads, and higher than 9800 bit rate.

http://esby.free.fr/CelticDruid/mirror/ffmpeg/


example syntax -

ffmpeg -i input.avs -threads 2 -vcodec mpeg2video -dc 10 -g 15 -bufsize 640 -minrate 12000 -b 16000 -maxrate 18000 -aspect 16:9 -s 1280x720 -an -mbd 2 -qmin 2 -async 1 -y "output.m2v"

yevlar
17th October 2006, 08:55
Danke!

I'll give that a try.

yevlar
17th October 2006, 11:00
A few issues I'm seeing with ffmpeg.

1 - I need to encode at 14.1 Mb/sec CBR for the video, but when I specify only 1 bitrate using -b, it still appears to be encoding CBR. How do I constrain the bitrate to 14.1 Mb?

2 - When I analyze the resulting .mpg file, the video bitrate is reported by MProbe at 104 Mb/sec - almost ten times the actual bitrate of the encode.

3 - I need to specify that the encode place a sequence header at the head of each GOP. Is there a command for this as well?

Pookie
17th October 2006, 20:56
The alternative is Mpeg2enc with the mod for HD. It needs AVS2YUV. When I was researching this, I copied the syntax below from http://crazedmuleproductions.blogspot.com/2006/10/exporting-hd-content-to-cam-it-is.html. This portion looks applicable - "--sequence-header-every-gop"


http://www.drecksoft.de/MPEG2ENC_HDTV.rar

http://akuvian.org/src/avisynth/avs2yuv/avs2yuv.exe

Syntax:

avs2yuv out.avs -o - | mpeg2enc --verbose 0 --aspect 3 --format 3 --frame-rate 4 --video-bitrate 14100 --nonvideo-bitrate 384 --interlace-mode 0 --force-b-b-p --video-buffer 448 --video-norm n --keep-hf --no-constraints --sequence-header-every-gop --min-gop-size 6 --max-gop-size 6 -o mpeg2.m2v


Analysis of the encoded output file I tested:

http://fileserver1.jpghosting.com/images/m2v_6a5be60cc86b5c5537f977e78c19baa1.jpg (http://www.jpghosting.com/showpic.php?image=m2v_6a5be60cc86b5c5537f977e78c19baa1.jpg)
Reading 'mpeg2.m2v' (22522880)
0xb3 (76): Sequence Header Code
Horizontal Size: 1280
Vertical Size: 720
Aspect Ratio: 3 (16:9)
Frame Rate: 4 (30000/1001 (29.97 fps))
0xb5 (10): Extension Start Code
Extension Type: 1 (Sequence Extension)
Profile and Level:
Escape Bit: 0
Profile: 4 (Main)
Level: 4 (High)
0xb5 (12): Extension Start Code
Extension Type: 2 (Sequence Display Extension)
Video Format: 2 (NTSC)
Display Horizontal Size: 1280
Display Vertical Size: 720
0xb8 (8): GOP Start Code
Closed GOP Flag: 1
Broken GOP Flag: 0
0x00 (8): Picture Start Code
Frame Type: 1 (I-Frame)
0xb5 (9): Extension Start Code
Extension Type: 8 (Picture Coding Extension)
0x01 (672): Video Slice
0x02 (848): Video Slice
0x03 (1015): Video Slice
0x04 (1052): Video Slice
0x05 (1022): Video Slice
0x06 (1374): Video Slice
0x07 (1601): Video Slice
0x08 (1570): Video Slice
0x09 (1596): Video Slice
0x0a (1558): Video Slice
0x0b (1577): Video Slice
0x0c (1564): Video Slice
0x0d (1564): Video Slice
0x0e (1616): Video Slice
0x0f (1719): Video Slice
0x10 (1970): Video Slice
0x11 (1961): Video Slice
0x12 (1959): Video Slice
0x13 (1968): Video Slice
0x14 (1960): Video Slice
0x15 (1957): Video Slice
0x16 (1948): Video Slice
0x17 (1957): Video Slice
0x18 (1972): Video Slice
0x19 (1975): Video Slice
0x1a (1980): Video Slice
0x1b (1971): Video Slice
0x1c (1980): Video Slice
0x1d (1969): Video Slice
0x1e (1977): Video Slice
0x1f (1991): Video Slice
0x20 (1981): Video Slice
0x21 (2009): Video Slice
0x22 (1988): Video Slice
0x23 (2016): Video Slice
0x24 (1998): Video Slice
0x25 (2012): Video Slice
0x26 (2009): Video Slice
0x27 (2011): Video Slice
0x28 (1998): Video Slice
0x29 (2015): Video Slice
0x2a (2009): Video Slice
0x2b (2011): Video Slice
0x2c (2017): Video Slice
0x2d (2002): Video Slice
0x00 (9): Picture Start Code
Frame Type: 2 (P-Frame)
0xb5 (9): Extension Start Code
Extension Type: 8 (Picture Coding Extension)
0x01 (172): Video Slice
0x02 (228): Video Slice
0x03 (315): Video Slice
0x04 (279): Video Slice
0x05 (306): Video Slice
0x06 (527): Video Slice
0x07 (741): Video Slice
0x08 (707): Video Slice
0x09 (723): Video Slice
0x0a (741): Video Slice
0x0b (765): Video Slice
0x0c (1091): Video Slice
0x0d (1367): Video Slice
0x0e (1424): Video Slice
0x0f (1433): Video Slice
0x10 (1420): Video Slice
0x11 (1478): Video Slice
0x12 (1526): Video Slice
0x13 (1584): Video Slice
0x14 (1604): Video Slice
0x15 (1556): Video Slice
0x16 (1590): Video Slice
0x17 (1641): Video Slice
0x18 (1645): Video Slice
0x19 (1598): Video Slice
0x1a (1629): Video Slice
0x1b (1657): Video Slice
0x1c (1601): Video Slice
0x1d (1626): Video Slice
0x1e (1608): Video Slice
0x1f (1628): Video Slice
0x20 (1640): Video Slice
0x21 (1571): Video Slice
0x22 (1448): Video Slice
0x23 (1378): Video Slice
0x24 (1353): Video Slice
0x25 (1340): Video Slice
0x26 (1349): Video Slice
0x27 (1361): Video Slice
0x28 (1356): Video Slice
0x29 (1348): Video Slice
0x2a (1377): Video Slice
0x2b (1359): Video Slice
0x2c (1342): Video Slice
0x2d (1320): Video Slice
0x00 (9): Picture Start Code
Frame Type: 2 (P-Frame)
0xb5 (9): Extension Start Code
Extension Type: 8 (Picture Coding Extension)
0x01 (980): Video Slice
0x02 (991): Video Slice
0x03 (1023): Video Slice
0x04 (1004): Video Slice
0x05 (1033): Video Slice
0x06 (1028): Video Slice
0x07 (1038): Video Slice
0x08 (1041): Video Slice
0x09 (1060): Video Slice
0x0a (1047): Video Slice
0x0b (1075): Video Slice
0x0c (1059): Video Slice
0x0d (1054): Video Slice
0x0e (1068): Video Slice
0x0f (1089): Video Slice
0x10 (1114): Video Slice
0x11 (1146): Video Slice
0x12 (1205): Video Slice
0x13 (1256): Video Slice
0x14 (1240): Video Slice
0x15 (1190): Video Slice
0x16 (1233): Video Slice
0x17 (1294): Video Slice
0x18 (1259): Video Slice
0x19 (1248): Video Slice
0x1a (1234): Video Slice
0x1b (1267): Video Slice
0x1c (1256): Video Slice
0x1d (1269): Video Slice
0x1e (1264): Video Slice
0x1f (1262): Video Slice
0x20 (1277): Video Slice
0x21 (1208): Video Slice
0x22 (1107): Video Slice
0x23 (1044): Video Slice
0x24 (1034): Video Slice
0x25 (1034): Video Slice
0x26 (1042): Video Slice
0x27 (1030): Video Slice
0x28 (1050): Video Slice
0x29 (1043): Video Slice
0x2a (1026): Video Slice
0x2b (1038): Video Slice
0x2c (1036): Video Slice
0x2d (1022): Video Slice
0x00 (9): Picture Start Code
Frame Type: 2 (P-Frame)
0xb5 (9): Extension Start Code
Extension Type: 8 (Picture Coding Extension)

yevlar
19th October 2006, 09:28
Looks like mpeg2enc doesn't mux the audio. The non-video bitrate option only specifies how many extra bits the final file will allow for future muxing with other materials (i.e. audio.) Also, the forced raw-YUV conversion slows down the encode to the point of being useless (took 90 minutes to encode a 2-minute clip on a dual-proc system.)

foxyshadis
19th October 2006, 20:34
Are you sure that's not just the avisynth script's fault? Piped raw yuv should be only marginally slower than internal yuv decoding (because of a couple extra memory transfers).

yevlar
21st October 2006, 15:43
Could be. I should play with it a bit more.

Regardless, I do need a muxer. I noticed a muxer called "mplex" on various sites associated with mpeg2enc, but it doesn't seem to accompany the executables. Anyone know where this tool is located, or what command enables it? Or, any ideas on other cli muxers available?

Pookie
21st October 2006, 19:09
The slowness is due to Mpeg2enc. It encodes at 1/5th the speed of FFmpeg.