[Mjpeg-users] divx-xvid 2 dvd resolution

2004-12-23 Thread Pedro Hernansáez
Hello friends:
im trying to convert divx-xvid to dvd, i use mplayer for frameserver and 
encoding
with mpeg2enc i type:

mkfifo stream.yuv
mplayer -vo yuv4mpeg -ao null divx.avi &
nice -10 mpeg2enc -f 8 -o video.mpg < stream.yuv
the problem is that the final mpeg2 don have the correct dimensions, 720x576 
for pal format
i know the | yuvscaler -O DVD | option.  from console:

mplayer -vo yuv4mpeg -ao null divx.avi &
nice -10 mpeg2enc -f 8 | yuvscaler -O DVD |  -o video.mpg < stream.yuv
but this gime a error with yuvscaler.
What im doing wrong.
regards
inspector77
_
Dale rienda suelta a tu tiempo libre. Encuentra mil ideas para exprimir tu 
ocio con MSN Entretenimiento. http://entretenimiento.msn.es/


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] divx-xvid 2 dvd resolution

2004-12-23 Thread Roger Ivie
On Thu, 23 Dec 2004, [iso-8859-1] Pedro Hernansáez wrote:
mplayer -vo yuv4mpeg -ao null divx.avi &
nice -10 mpeg2enc -f 8 | yuvscaler -O DVD |  -o video.mpg < stream.yuv
but this gime a error with yuvscaler.
But you're not going to tell us what the error is.
I'm willing to bet it's "cannot determine standard" or whatever the
wording is because yuvscaler can't tell whether -O DVD means a PAL or
NTSC DVD and you need to use:
yuvscaler -n p -O DVD
or whatever the PAL syntax is (I'm in NTSC country).
--
Roger Ivie
[EMAIL PROTECTED]
http://anachronda.webhop.org/
-BEGIN GEEK CODE BLOCK-
Version: 3.12
GCS/P d- s:+++ a+ C++ UB--() !P L- !E W++ N++ o-- K w O- M+ V+++ PS+
PE++ Y+ PGP t+ 5+ X-- R tv++ b++ DI+++ D+ G e++ h--- r+++ z+++ 
--END GEEK CODE BLOCK--

Re: [Mjpeg-users] divx-xvid 2 dvd resolution

2004-12-23 Thread Bernhard Praschinger
Hallo

> im trying to convert divx-xvid to dvd, i use mplayer for frameserver and
> encoding
> with mpeg2enc i type:
> 
> mkfifo stream.yuv
> 
> mplayer -vo yuv4mpeg -ao null divx.avi &
> nice -10 mpeg2enc -f 8 -o video.mpg < stream.yuv
> 
> the problem is that the final mpeg2 don have the correct dimensions, 720x576
> for pal format
> i know the | yuvscaler -O DVD | option.  from console:
> 
> mplayer -vo yuv4mpeg -ao null divx.avi &
> nice -10 mpeg2enc -f 8 | yuvscaler -O DVD |  -o video.mpg < stream.yuv
> 
> but this gime a error with yuvscaler.
try something like that:
cat stream.yuv | yuvscaler -O DVD | mpeg2enc -f 8 -o video.m2v

> What im doing wrong.
read the mjpeg howto. 

auf hoffentlich bald,

Berni the Chaos of Woodquarter

Email: [EMAIL PROTECTED]
www: http://www.lysator.liu.se/~gz/bernhard


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] divx-xvid 2 dvd resolution

2004-12-23 Thread Steven M. Schultz
On Thu, 23 Dec 2004, Roger Ivie wrote:
On Thu, 23 Dec 2004, [iso-8859-1] Pedro Hernansáez wrote:
> mplayer -vo yuv4mpeg -ao null divx.avi &
> nice -10 mpeg2enc -f 8 | yuvscaler -O DVD |  -o video.mpg < stream.yuv
>
> but this gime a error with yuvscaler.
But you're not going to tell us what the error is.
I was going to say the same thing :)  Seeing the actual log messages
from the commands would have been very helpful.
I'm willing to bet it's "cannot determine standard" or whatever the
wording is because yuvscaler can't tell whether -O DVD means a PAL or
NTSC DVD and you need to use:
yuvscaler -n p -O DVD
Be careful though.  If you get something like Divx in an AVI container
the video has almost certainly been mangled (thru cropping and/or
scaling) into an exact 4/3 image using _square_ pixels.
To properly resample (scale) the data and preserve the aspect ratio
it is necessary to take into account the 1:1 input SAR (Sample Aspect
Ratio) and the target SAR.  For 625line ("PAL") systems the SAR is
59:54 (for  525line, "NTSC", it's 10:11).
	It should never be necessary to arbitrarily give "-n p" or "-n n" - if 
	the stream has the proper attributes the encoder will be able to
	do the Right Thing.

	Use 'y4mscaler' (not part of mjpegtools - you can get y4mscaler from 
	http://www.mir.com/DMG/Software/y4mscaler.html , use 0.6.2 if you're
	using mjpegtools 1.6.2, use 0.7.1 if you're running the cvs version
	of mjpegtools) thus:

... | y4mscaler -I sar=1:1 -O sar=59:54 -O preset=DVD -S option=sinc:4 | ...
Actually I'd use something like:
	y4mscaler -I sar=1:1 -O sar=59:54 -O size=704x576 -S option=sinc:4 

because 704xN is the full frame (and is a valid DVD size).  DV and DVD
frames are 720xN but they've captured an extra 8 pixels on each side
(which you don't see on a TV set anyhow due to overscan).  But if you
require 720xN then go ahead and specify that - the scaler will do
the right thing (likely with padding an extra 8 pixels on each side ;))
y4mscaler will pad/crop as needed to carry out the specified operation.
As a real life example here's the scaling step I use to downscale
HDTV to widescreen DVD format:
y4mscaler -I active=1920x1080+0+0 -O infer=exact -O sar=40:33 -O size=704x480 \
  -S option=sinc:6 

	The input stream was encoded as 1920x1088 with the MPEG-2 "VDS" 
	(vertical display size) set to 1080 thus I tell the scaling to only
	pay attention to the first 1080 lines and then target widescreen
	(40:33 for "NTSC") 704x480.  PERFECT match and comes out looking
	great.

Good Luck!
Cheers,
Steven Schultz

---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


[Mjpeg-users] generating HDTV

2004-12-23 Thread Dave Dodge
I want to _generate_ HD output; ideally an ATSC-compliant TS but a
720p30 video ES would be a good start.  I have my animation/rendering
program configured to produce 1280x720 PPM frames at 30 frames per
second.

Here's what I currently use, based on some wild guesses.  Does anyone
see any glaring problems with these settings?  I've kept all of the
source frames in case I need to re-encode them.

cat *.ppm \
| ppmtoy4m -n 150 -F 30:1 -A 1:1 -I p -S 420_mpeg2 \
| mpeg2enc \
  --no-constraints \
  --format 3 \
  --b-per-refframe 0 \
  --video-bitrate 19000 \
  --video-buffer 500 \
  --no-dummy-svcd-SOF \
  --min-gop-size 15 \
  --max-gop-size 15 \
  --closed-gop \
  --keep-hf \
  --intra_dc_prec 11 \
  --output outputfile.mpg

With the above settings I found that mjpegtools-1.6.2 initially
complained about the bitrate and/or dc precision being out of range.
Is there any way to select the high level and high profile settings on
the command line?  I couldn't find any and ended up patching the
defaults in the code in order to fix it:

  profile = 1;
  level = 4;

I suspect the bitrate might be too high if I want to stay within the
bounds of broadcast ATSC, since packetization will add overhead.  But
the data will probably be delivered over Ethernet from a file server
instead of actually sent over the air, so I'm not too concerned about
it.  There's not intended to be any audio associated with the video,
so I don't think I need to leave any room for it.

FYI the intended application is a screensaver-like program for an HDTV
set-top box.  The files as generated above do play with things like
mplayer, but I haven't had a chance to get them turned into transport
streams and try them with the intended hardware (the API there insists
on a TS).  There seem to be several free programs to tear transport
streams apart but very few for constructing them.


  -Dave Dodge


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] generating HDTV

2004-12-23 Thread Steven M. Schultz

On Thu, 23 Dec 2004, Dave Dodge wrote:

> I want to _generate_ HD output; ideally an ATSC-compliant TS but a
> 720p30 video ES would be a good start.  I have my animation/rendering

I know the ABC network (and I think FOX) are using the 720p but it's
60 frames/sec not 30 (well, ok - 6/1001 ;))

> program configured to produce 1280x720 PPM frames at 30 frames per
> second.

30fps is a valid ATSC rate (as is 3/1001)

> see any glaring problems with these settings?  I've kept all of the

What you're going to run into when trying to work with HD output is
that 'mpeg2enc' is a [EMAIL PROTECTED] (Main Profile @ Main Level) 
encoder and
not a HL (High Level) encoder.  While "--intra_dc_prec 11" ("-D 11")
_appears_ available it falls into the same category as "-F 6" (50
frame/sec) thru "-F 8" (60 frames/sec) - it doesn't really work.

> cat *.ppm \
> | ppmtoy4m -n 150 -F 30:1 -A 1:1 -I p -S 420_mpeg2 \
> | mpeg2enc \
> --no-constraints \
>   --format 3 \
> --b-per-refframe 0 \
> --video-bitrate 19000 \
> --video-buffer 500 \
> --no-dummy-svcd-SOF \
> --min-gop-size 15 \
> --max-gop-size 15 \
> --closed-gop \
> --keep-hf \
> --intra_dc_prec 11 \
> --output outputfile.mpg
> 
> With the above settings I found that mjpegtools-1.6.2 initially
> complained about the bitrate and/or dc precision being out of range.

Upgrade to the cvs version if you're going to try and do anything
with HD content.  It's possible to cajole mpeg2enc into doing the
above but there was a bug in 1.6.2 - basically the "--no-constraints"
didn't work (did not have the desired effect(s)).

"-D 10" (--intra_dc_prec 10) should work fine - I don't know if the
11bit has ever been tested (since it's not allowed with [EMAIL 
PROTECTED] MPEG-2).

> Is there any way to select the high level and high profile settings on
> the command line?  I couldn't find any and ended up patching the

You won't be able to use -F6 thru 8 but if you use the CVS version
the higher bitrate and framesize can be (with --no-constraints) be
made to work.

> I suspect the bitrate might be too high if I want to stay within the
> bounds of broadcast ATSC, since packetization will add overhead.  But

Most of the HD stations I watch are the [EMAIL PROTECTED]/1001 format.
(the stream is actually 1920x1088 since 1088 is a multiple of 16 and
the 'vertical display size' field of the mpeg2 header is set to 1080 -
I've requested that the ability to set the 'vertical display size'
be added to mpeg2enc).  

To continue on... ;)  The stations broadcast a SD and an HD program
at the same time - they use about 14Mb/s for the HD (with a 384Kb/s
5.1 AC3 audio track) and about 5Mb/s or so for the SD stream.  19Mb/s
should be ok but you might want to back down just a little to leave 
room for the overhead.  The VBV size I've seen used is 488 (which is 
close to the 500 you've specified)

> it.  There's not intended to be any audio associated with the video,
> so I don't think I need to leave any room for it.

Silent movie era in High Definition :)

To generate the TS stream you may want to give ProjectX a try - I use
that all the time to _de_mux TS streams (captured via IEEE1394 from
a tuner I have) but ProjectX also appears to be able to _create_
TS streams from elementary input files.

> on a TS).  There seem to be several free programs to tear transport
> streams apart but very few for constructing them.

http://www.lucike.info/index.htm?http://www.lucike.info/page_projectx.htm

might be worth a try - runs nicely for demuxing (on both OS/X and
linux).

Cheers,
Steven Schultz



---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users


Re: [Mjpeg-users] generating HDTV

2004-12-23 Thread Dave Dodge
On Thu, Dec 23, 2004 at 02:59:30PM -0800, Steven M. Schultz wrote:
> On Thu, 23 Dec 2004, Dave Dodge wrote:
[...]
>   30fps is a valid ATSC rate (as is 3/1001)

Yeah, I at least checked on that before proceeding.  I agree that I
don't think I've ever seen 30fps content in the wild but since it's
allowed I'm hoping the decoder will take it.

>   What you're going to run into when trying to work with HD output is
>   that 'mpeg2enc' is a [EMAIL PROTECTED] (Main Profile @ Main Level) 
> encoder and
>   not a HL (High Level) encoder.

Right, that's basically what caused the problems initially, since
those settings were hardcoded.  I noticed that the tables in the
sourcecode had entries for the other profiles/levels and it _seems_ to
work if I just change the hardcoded settings to point to them; but I
don't know enough to be sure if it's really generating correct output.
The software decoders I've been testing with are probably more lenient
than the hardware decoder I'm intending this for.

>   Upgrade to the cvs version if you're going to try and do anything
>   with HD content.

Thanks, I'll give that a shot.

>   Most of the HD stations I watch are the [EMAIL PROTECTED]/1001 format.

Same here, and the decoder I'm using has no problem handling it.  I
did try a couple of test frames at that resolution but for the
rendering software I'm using (electricsheep.org), higher resolution
means huge amounts of additional RAM and a lot more time -- and 1280x720
is already pretty much at the limit for my rendering machine.

>   To continue on... ;)  The stations broadcast a SD and an HD program
>   at the same time

I think the local CBS broadcaster is strictly HD, but course they
might change that if/when they lose their analog station.  On the
other hand, the local PBS station has five programs with multiple
audio PIDs per program and they change the bandwidth allocation
depending on the time of day.  Some old test data here:

  http://www.dododge.net/roku/ts-samples.html

>   19Mb/s should be ok but you might want to back down just a little
>   to leave room for the overhead.  The VBV size I've seen used is
>   488 (which is close to the 500 you've specified)

The buffers are probably my main concern.  It's known from test cases
that this decoder can handle bitrates up into the 30Mb/sec range,
provided you can get the data into it at that speed.  But I don't want
it to have to drop frames or lose sync while decoding because some
internal buffer overflows.

>   Silent movie era in High Definition :)

Pretty much.  I believe the hardware can play a separate stream (such
as an MP3 file) as background music to whatever TS you give it, so I
don't need to provide my own audio within the TS.  Of course a problem
with that is that some muxers might require an audio ES in order to
work at all.

>   To generate the TS stream you may want to give ProjectX a try

I have that one on my TODO list as the most likely candidate to work.
I've made some brief attempts with other muxers without success.

  -Dave Dodge


---
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
___
Mjpeg-users mailing list
Mjpeg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mjpeg-users