Mailing List Archive

nuv -> svcd
well, I'm about to give up. I think I have svcd mpeg encoding working
to a "done" point (ie. it works), but I'd like to be able to use the
cutlist. I can get mplayer to work with its -edl flag on a file I
generate from myth's cutlist, but for some reason the audio goes out of
sync after awhile (about 1 second fast at the end of what was originally
a 30 minute show).

If anyone is curious, this is what I'm using:

# make a fifo for mplayer
mkfifo -m 600 stream.yuv

# you HAVE to background this process, or run it in a different console
mplayer -noframedrop -vo yuv4mpeg -ao pcm -waveheader -v -osdlevel 0
myfile.nuv &

# lots of stuff - note multi-thread and kill if if you don't have
# two cpu's
nice -n 19 yuvdenoise < stream.yuv | nice -n 19 yuvscaler -v 0 -n n -M
BICUBIC -O SVCD | nice -n 19 mpeg2enc --format 5 --quantisation 10
--video-bitrate 2500 --aspect 2 --frame-rate 4 --interlace-mode 0
--motion-search-radius 32 --video-buffer 300 --nonvideo-bitrate 192
--sequence-length 795 --multi-thread 2 -o out.mpv

# I like toolame over mp2enc - I have an rpm if anyone wants it
toolame -m j -b 192 audiodump.wav out.mp2

# mplex
mplex -f 5 out.mpv out.mp2 -o out.mpg

---

Anyway, it works seemingly flawlessly with -f 4 (standard svcd), and I'm
just now running a test with -f 5 (custom svcd, allows for some more
control over encoding settings, etc). But the instant I start using the
edl, things go out of sync (though other than that, it does "seem" to
work - commercials are cut out of both the video and the audio). Thus,
all of this would be solved if the copy-only transcode stuff in
mythbackend were to get finished (fingers crossed) - actually, even a
little utility to specify things by hand would be fine with me.

-Chris

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
> all of this would be solved if the copy-only transcode stuff in
> mythbackend were to get finished (fingers crossed) - actually, even a
> little utility to specify things by hand would be fine with me.

the 'mythtranscode' program is not what your looking for?

i believe you initialize it like this:
mythtranscode -l -k -p Transcode-Archival -s 2003-07-11-00:00:00 -c 1040

at least thats how the mythmkmovie program uses it... and it does appear
to use the cutlist just fine in mythmkmovie.

Sean

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
On Mon, 2003-07-14 at 02:02, mojo wrote:
> > all of this would be solved if the copy-only transcode stuff in
> > mythbackend were to get finished (fingers crossed) - actually, even a
> > little utility to specify things by hand would be fine with me.
>
> the 'mythtranscode' program is not what your looking for?
>
> i believe you initialize it like this:
> mythtranscode -l -k -p Transcode-Archival -s 2003-07-11-00:00:00 -c 1040
>
> at least thats how the mythmkmovie program uses it... and it does appear
> to use the cutlist just fine in mythmkmovie.
>
> Sean
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users@snowman.net
> http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users


Forgive my ignorance, but what is this cutlist I keep seeing?

And..

where do I add that code you listed to mythencode.pl script to get it
to do svcd instead of divx/avi??
You'll have to forgive my n00bness on such things as video encoding and
the like.

Thanks,
Jeff

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
> Forgive my ignorance, but what is this cutlist I keep seeing?

while watching a recording, press "m" - it brings up mythtv's editor,
where you can cut out commercials (or import from the auto-flagged list
if "flag commercials" is turned on - with "z").

> where do I add that code you listed to mythencode.pl script to get it
> to do svcd instead of divx/avi??

you'll need to do more than just paste that into mythencode. I pasted
that as an example of what needs to be done. When (if) I get all of
this working, I'll make my script available, and I'm sure that it'll
also get integrated into mythmkmovie.

-Chris

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
> the 'mythtranscode' program is not what your looking for?
> i believe you initialize it like this:
> mythtranscode -l -k -p Transcode-Archival -s 2003-07-11-00:00:00 -c 1040

That would be nice if mythtranscode could do mpeg2.

> at least thats how the mythmkmovie program uses it... and it does appear
> to use the cutlist just fine in mythmkmovie.

mythmkmovie cheats, sort of. it encodes the movie in chunks, and then
joins them together. However, at the moment, this may be the only/best
way to do things. I need to look at that code again and see if it can
be used for svcd.

-Chris

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
Chris Petersen wrote:

>>the 'mythtranscode' program is not what your looking for?
>>i believe you initialize it like this:
>>mythtranscode -l -k -p Transcode-Archival -s 2003-07-11-00:00:00 -c 1040
>
>
> That would be nice if mythtranscode could do mpeg2.
>
mythtranscode dumps out a new .nuv of the same name except it has .tmp
added on the end (if i was reading the output of mythmkmovie correctly)
and that .nuv is in whatever format or codec you specify with the -p
profile option... i am assuming the 'Transcode' profile is the default.

>
>>at least thats how the mythmkmovie program uses it... and it does appear
>>to use the cutlist just fine in mythmkmovie.
>
>
> mythmkmovie cheats, sort of. it encodes the movie in chunks, and then
> joins them together. However, at the moment, this may be the only/best
> way to do things. I need to look at that code again and see if it can
> be used for svcd.
>

when mythmkmovie was used with the transcode option enabled i think i
noticed that it only did one segment because the file was already
transcoded using the cutlist (dont forget that checkbox for using the
cutlist during transcoding in the setup program) im not entirely sure
whether it matters or not at this point but i would try it ;-)

i think we miscommunicated a bit... i never meant to say use
mythtranscode to make svcds... i meant that if you use mythtranscode
first to make a new .nuv with the same or whatever settings you want and
then it also cuts out the commercials for you using the cutlist then you
dont need to mess with the -edl stuff that was throwing your audio out
of whack. then take the transcoded .nuv.tmp file and do all those steps
you did to make the svcds... maybe that doesnt work and im wrong about
some of that stuff but thats what i meant to suggest anyway. :-)

Sean

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
> mythtranscode dumps out a new .nuv of the same name except it has .tmp
> added on the end (if i was reading the output of mythmkmovie correctly)
> and that .nuv is in whatever format or codec you specify with the -p
> profile option... i am assuming the 'Transcode' profile is the default.

yeah, I gathered that. But when using the cutlist, does it re-encode,
or just copy the stream, leaving out the cut-out bits?

If this is the case, then yes, I'm more than happy to use the
mythtranscode to apply my cutlist changes (heck, I'd do it long before I
encoded to svcd just to save space on the things that need to stay live
on the box).

However, if it re-encodes things, there's no point in doing this. every
time you re-encode stuff, you lose quality. and the quality is already
poor enough.

-Chris

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
From: Chris Petersen <lists@forevermore.net>
>well, I'm about to give up. I think I have svcd
>mpeg encoding working
>to a "done" point (ie. it works), but I'd like
>to be able to use the
>cutlist. I can get mplayer to work with its
>-edl flag on a file I
>generate from myth's cutlist, but for some
>reason the audio goes out of
>sync after awhile


Interesting. Does mplayer exhibit the same
behavior if you send the output to the video card
and sound card (i.e. no -vo -ao options)?
If so, then it sounds like there's a fundamental
problem (bug) in mplayer.

-Dennis

__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com
_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
> Interesting. Does mplayer exhibit the same
> behavior if you send the output to the video card
> and sound card (i.e. no -vo -ao options)?
> If so, then it sounds like there's a fundamental
> problem (bug) in mplayer.

good point. I'll have to check this when I get home.

Though my main thought is that it's a 29.97 vs 30 fps issue - not that I
could explain why the same encoding settings could produce different
frame rates (unless the edl is changing something).

-Chris

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
> Interesting. Does mplayer exhibit the same
> behavior if you send the output to the video card
> and sound card (i.e. no -vo -ao options)?
> If so, then it sounds like there's a fundamental
> problem (bug) in mplayer.

Well, mplayer SEEMS to play the stream just fine. It's hard to say for
sure without watching the whole thing end-to-end because it won't skip
ahead very well when running with the edl.

Anyway, this leads me to believe that there is some kind of framerate
conversion (or something like it) going on, since:

mplayer -noframedrop -vo yuv4mpeg -ao pcm -waveheader \
-v -osdlevel 0 file.nuv

works perfectly, and

mplayer -noframedrop -vo yuv4mpeg -ao pcm -waveheader \
-v -osdlevel 0 -edl file.edl file.nuv

does not (audio goes out of sync by about 1 second too-fast per
originally-half-hour of video). I've continued to use the same encoding
settings:

nice -n 19 yuvdenoise < stream.yuv \
| nice -n 19 yuvscaler -v 0 -n n -M BICUBIC -O SVCD \
| nice -n 19 mpeg2enc --format 5 --quantisation 10 \
--video-bitrate 2500 --aspect 2 --frame-rate 4 \
--interlace-mode 0 --motion-search-radius 32 \
--video-buffer 300 --nonvideo-bitrate 192 \
--sequence-length 795 --multi-thread 2 -o file.mpv

toolame -m j -b 192 audiodump.wav file.mp2
tcmplex -m s -i file.mpv -p file.mp2 -o file.mpg

I use tcmplex because it's a bit (a LOT) more reliable with svcd than
mplex is. And toolame is just a better mp2 encoder than mp2enc (and
allows joint stereo).

Anyway, I'm completely open to suggestions here. I've checked the
framerates on all files, and they're reading at 29.97, so that SEEMS
fine. dunno what to say. Hopefully mythtranscoder stuff will get
updated soon to allow for non-transcoding commercial cutting (or
released, since there has been talk of that patch being included in the
tree).

-Chris

So I'm going to take at least a little break from this stuff and go back
to mythweb for awhile. If anyone has any ideas, or more luck, please
let me know.

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
Does toolame have a CBR (constant bit-rate) option? After recent hours of
tooth-gnashing dealing with similar problems, that's the first thing I'd
look at....

--Kevin Lenth

> Anyway, this leads me to believe that there is some kind of framerate
> conversion (or something like it) going on, since:
>
> mplayer -noframedrop -vo yuv4mpeg -ao pcm -waveheader \
> -v -osdlevel 0 file.nuv
>
> works perfectly, and
>
> mplayer -noframedrop -vo yuv4mpeg -ao pcm -waveheader \
> -v -osdlevel 0 -edl file.edl file.nuv
>
> does not (audio goes out of sync by about 1 second too-fast per
> originally-half-hour of video). I've continued to use the same encoding
> settings:
>
> nice -n 19 yuvdenoise < stream.yuv \
> | nice -n 19 yuvscaler -v 0 -n n -M BICUBIC -O SVCD \
> | nice -n 19 mpeg2enc --format 5 --quantisation 10 \
> --video-bitrate 2500 --aspect 2 --frame-rate 4 \
> --interlace-mode 0 --motion-search-radius 32 \
> --video-buffer 300 --nonvideo-bitrate 192 \
> --sequence-length 795 --multi-thread 2 -o file.mpv
>
> toolame -m j -b 192 audiodump.wav file.mp2
> tcmplex -m s -i file.mpv -p file.mp2 -o file.mpg
>
> I use tcmplex because it's a bit (a LOT) more reliable with svcd than
> mplex is. And toolame is just a better mp2 encoder than mp2enc (and
> allows joint stereo).
>
> Anyway, I'm completely open to suggestions here. I've checked the
> framerates on all files, and they're reading at 29.97, so that SEEMS
> fine. dunno what to say. Hopefully mythtranscoder stuff will get
> updated soon to allow for non-transcoding commercial cutting (or
> released, since there has been talk of that patch being included in the
> tree).
>
> -Chris
>
> So I'm going to take at least a little break from this stuff and go back
> to mythweb for awhile. If anyone has any ideas, or more luck, please
> let me know.
_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
> Does toolame have a CBR (constant bit-rate) option? After recent hours of
> tooth-gnashing dealing with similar problems, that's the first thing I'd
> look at....

I'm using it in CBR mode (vbr it an extra command line parameter - at
least that's how I'm reading the help). Besides, I've tested it with
mp2enc - same problem.

-Chris

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
Chris Petersen wrote:
>>mythtranscode dumps out a new .nuv of the same name except it has .tmp
>>added on the end (if i was reading the output of mythmkmovie correctly)
>>and that .nuv is in whatever format or codec you specify with the -p
>>profile option... i am assuming the 'Transcode' profile is the default.
>
>
> yeah, I gathered that. But when using the cutlist, does it re-encode,
> or just copy the stream, leaving out the cut-out bits?
>

it re-encodes but if you use the same settings i dont know how much
quality degradation would actually occur... i would say to try it and
see.. if you cant visibly notice the quality difference between the
.nuv.tmp and the original .nuv then whats the difference?

Sean

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: nuv -> svcd [ In reply to ]
> it re-encodes but if you use the same settings i dont know how much
> quality degradation would actually occur... i would say to try it and
> see.. if you cant visibly notice the quality difference between the
> .nuv.tmp and the original .nuv then whats the difference?

re-encoding ALWAYS loses quality. artifacts turn into more artifacts.
It's already bad enough going from nuv mpeg4 into svcd mpeg2. I'm
patient and can wait for the non-transcode cutlist thingie. And maybe
someday I'll figure out how to get the edl stuff working properly. I
just don't know enough about encoding svcd's using the linux tools (the
windows ones like TMPGEnc are sadly WAY ahead in that game)

-Chris

_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users