Hi! I have a DV stream that I'm trying to encode for DVD. I have an NTSC DV camera, and it shoots in 30000/1001. I can encode it perfectly well into 30000:1001 MPEG-2.

As an experiment, I wanted to make a 24000/1001 encoding (I didn't really care about the output quality, I just was curious). When I encode, I use mplayer to pipe the video's yuv stream to a named fifo (stream.yuv). While that is going on the background, I cat the fifo through yuv2fps and then to mpeg2enc.

After reading mpeg2enc's man page, I decided that changing -F 4 to -F 1 and adding -p would work. However, I was wrong and mpeg2enc changed the frame rate number to 4 (30000/1001) when it started. The man page gave me the impression that -p would work for 24fps _source_ material and tell the decoder to do pulldown at playtime. yuv2fps changed the framerate to 24000/1001, but mpeg2enc still encoded at 30000/1001.

By removing -p, I got things to work and mpeg2enc kept the source's 24000:1001 frame rate. What am I not understanding about using -p?

Thanks,
Joe

====================================
From mpeg2enc's man page:

      -F|--frame-rate num

Set the frame-rate of the output-stream. By default, this value is inferred from the input header. Currently only the standard MPEG rates are supported. Eventually more-or-less arbitrary rates will be possible.
       0 - illegal
       1 - 24000.0/1001.0 (NTSC 3:2 pulldown converted FILM)
       2 - 24.0 (NATIVE FILM)
       3 - 25.0 (PAL/SECAM VIDEO / converted FILM)
       4 - 30000.0/1001.0 (NTSC VIDEO)
       5 - 30.0
       6 - 50.0 (PAL FIELD RATE)
       7 - 60000.0/1001.0 (NTSC FIELD RATE)
       8 - 60.0

      -p|--3-2-pulldown

Setting -p only makes sense for 24frame/sec Movie source material. It sets flags in the output stream that tell the decoder to play the movie as NTSC 60field/sec video using "3:2 pulldown". This is vastly more efficient than encoding as 60field/sec video. The classic application is to transcode a PAL-encoded movie (24fps played too fast at 25 fps!) into
      NTSC (see the -f flag).


====================================
Doesn't work:

cat stream.yuv | yuvfps -r 24000:1001 -v 1 | nice -n 0 mpeg2enc -S 4500 -B 304 -a 2 -f 8 -b 7840 -g 4 -G 9 -D 10 -F 1 -p -v 1 -n n -4 2 -2 1 -q 5 -H -o "ntscfilm-test.m2v"

result:
INFO: [yuvfps] yuv2fps (version 0.1) is a general frame resampling utility for yuv streams INFO: [yuvfps] (C) 2002 Alfonso Garcia-Patino Barbolani <[EMAIL PROTECTED]>
  INFO: [yuvfps] yuvfps -h for help, or man yuvfps
++ WARN: [yuvfps] Original framerate: 29970029:1000000, Normalized framerate: 30000:1001
++ WARN: [yuvfps] Converting from 30000:1001 to 24000:1001
  INFO: [mpeg2enc] SETTING EXTENDED MMX for MOTION!
  INFO: [mpeg2enc] SETTING MMX for TRANSFORM!
  INFO: [mpeg2enc] SETTING EXTENDED MMX for PREDICTION!
  INFO: [mpeg2enc] Selecting DVD output profile
  INFO: [mpeg2enc] Progressive input - selecting progressive encoding.
++ WARN: [mpeg2enc] 3:2 movie pulldown with frame rate set to decode rate not display rate ++ WARN: [mpeg2enc] 3:2 Setting frame rate code to display rate = 4 (29.970 fps)
  INFO: [mpeg2enc] Encoding MPEG-2 video to ntscfilm-test.m2v
  INFO: [mpeg2enc] Horizontal size: 720 pel
  INFO: [mpeg2enc] Vertical size: 480 pel
  INFO: [mpeg2enc] Aspect ratio code: 2 = 4:3 display
  INFO: [mpeg2enc] Frame rate code:   4 = 30000.0/1001.0 (NTSC VIDEO)
  INFO: [mpeg2enc] Bitrate: 7840 KBit/s
  INFO: [mpeg2enc] Quality factor: 5 (Quantisation = 5) (1=best, 31=worst)
  INFO: [mpeg2enc] Field order for input: none/progressive
  INFO: [mpeg2enc] New Sequence every 4500 Mbytes
  INFO: [mpeg2enc] Assuming non-video stream of 304 Kbps
  INFO: [mpeg2enc] Search radius: 16
  INFO: [mpeg2enc] GOP SIZE RANGE 4 TO 9
  INFO: [mpeg2enc] Setting colour/gamma parameters to "NTSC"
  INFO: [mpeg2enc] Progressive format frames = 1
  INFO: [mpeg2enc] 3:2 Pulldown selected frame decode rate = 23.976 fps
  INFO: [mpeg2enc] Setting hi-res intra Quantisation matrix
  INFO: [mpeg2enc] Buffering 21 frames


====================================
Works:

cat stream.yuv | yuvfps -r 24000:1001 -v 1 | nice -n 0 mpeg2enc -S 4500 -B 304 -a 2 -f 8 -b 7840 -g 4 -G 9 -D 10 -F 1 -v 1 -n n -4 2 -2 1 -q 5 -H -o "ntscfilm-test-no-p.m2v"

result:

INFO: [yuvfps] yuv2fps (version 0.1) is a general frame resampling utility for yuv streams INFO: [yuvfps] (C) 2002 Alfonso Garcia-Patino Barbolani <[EMAIL PROTECTED]>
  INFO: [yuvfps] yuvfps -h for help, or man yuvfps
++ WARN: [yuvfps] Original framerate: 29970029:1000000, Normalized framerate: 30000:1001
++ WARN: [yuvfps] Converting from 30000:1001 to 24000:1001
  INFO: [mpeg2enc] SETTING EXTENDED MMX for MOTION!
  INFO: [mpeg2enc] SETTING MMX for TRANSFORM!
  INFO: [mpeg2enc] SETTING EXTENDED MMX for PREDICTION!
  INFO: [mpeg2enc] Selecting DVD output profile
  INFO: [mpeg2enc] Progressive input - selecting progressive encoding.
  INFO: [mpeg2enc] Encoding MPEG-2 video to ntscfilm-test-no-p.m2v
  INFO: [mpeg2enc] Horizontal size: 720 pel
  INFO: [mpeg2enc] Vertical size: 480 pel
  INFO: [mpeg2enc] Aspect ratio code: 2 = 4:3 display
INFO: [mpeg2enc] Frame rate code: 1 = 24000.0/1001.0 (NTSC 3:2 pulldown converted FILM)
  INFO: [mpeg2enc] Bitrate: 7840 KBit/s
  INFO: [mpeg2enc] Quality factor: 5 (Quantisation = 5) (1=best, 31=worst)
  INFO: [mpeg2enc] Field order for input: none/progressive
  INFO: [mpeg2enc] New Sequence every 4500 Mbytes
  INFO: [mpeg2enc] Assuming non-video stream of 304 Kbps
  INFO: [mpeg2enc] Search radius: 16
  INFO: [mpeg2enc] GOP SIZE RANGE 4 TO 9
  INFO: [mpeg2enc] Setting colour/gamma parameters to "NTSC"
  INFO: [mpeg2enc] Progressive format frames = 1
  INFO: [mpeg2enc] Setting hi-res intra Quantisation matrix
  INFO: [mpeg2enc] Buffering 21 frames



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users

Reply via email to