LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxAnswers Discussion
User Name
Password
LinuxAnswers Discussion This forum is to discuss articles posted to LinuxAnswers.

Notices

Reply
 
Search this Thread
Old 10-01-2004, 09:04 PM   #31
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30

I just wanted to drop in and say that this is a great script indeed. There are so many out there that don't even work, but this one does (at least on the avi's i tried it on).

Thanks and keep up the good work.
 
Old 10-02-2004, 02:36 AM   #32
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Original Poster
Rep: Reputation: 48
Thanks! I'm just happy that someone besides me finds it useful. If you do run into any problems, let me know!
 
Old 10-03-2004, 12:01 AM   #33
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
Will do.

I guess many scripts in the past have died because the developers didn't keep up with the changes made in mplayer/mencoder/ffmpeg. It always happens, the commands or arguments get changed, and then the script becomes useless. Hopefully the same doesn't happen to this one.
 
Old 10-03-2004, 10:37 AM   #34
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Original Poster
Rep: Reputation: 48
As long as I keep using the script myself, I will definitely keep up on maintenance and continue to improve it. I've been doing a lot of DVD-making lately, and am using it almost every day. And of course, one of the great things about open source is that even if I stop maintaining it, someone else can take over.
 
Old 10-03-2004, 06:02 PM   #35
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
True.

I did run into a problem (using tovid from sourceforge, non gui). Actually, i am not even sure if its even a script problem. I have someting in .asf extension. So i ran the script as usual (svcd, full), and the resulting mpeg, when played by mplayer, plays really fast, then ends. Its weird, but i have never really gotten *.asf's to ever encode into a vcd mpeg. Is there a extra step one has to do to do this correctly? I found the following:

http://www.greenspun.com/bboard/q-an...?msg_id=004IhX

And quite a few results on google that say the same thing:

Google Search.

They are suggesting to turn it into a avi first, then into a mpeg. Problem is they all say how to do it in windows, and i am not sure how to do it in linux.

mplayer exits out with the following when the resulting mpeg from tovid has finished playing:

Quote:
Too many audio packets in the buffer: (3654 in 8389584 bytes). Maybe you are playing a non-interleaved stream/file or the codec failed? For AVI files, try to force non-interleaved mode with the -ni option. A: 18.9 V: 18.8 A-V: 0.134 ct: 0.056 549/549 14% 4% 3.1% 3 0 26% Successfully enabled DPMS Exiting... (End of file)
The video was identified as the following:

Quote:
./tovid svcd full some.asf -------------------------------- tovid video conversion script Version 0.11 Written in 2004 by Eric Pierce wapcaplet99[at]yahoo dot com -------------------------------- ********************************************************* Input file is 320 x 240 at 1000.000 fps. Source is not at an NTSC frame rate. Adjusting FPS to 29.97. Source is within 10% of target aspect ratio. Assuming correct aspect ratio and rescaling.
Oh wow. 1000.00fps, just noticed that.

Let me know if you need more info.

Thanks.

Last edited by sk545; 10-03-2004 at 06:11 PM.
 
Old 10-03-2004, 07:29 PM   #36
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Original Poster
Rep: Reputation: 48
Yeah, if there is a strange frame rate, the script will have some problems with it. This is one of the main sources of frustration I'm having at the moment - anything other than NTSC (29.97fps) or PAL (25.00fps), and sometimes film (23.796fps) for whatever reason usually does not get encoded properly. I even had a video recently that was 29.971 fps (0.001 different than 29.97) which seemed to encode fine, but the audio and video gradually got more and more out of sync in the finished movie. With weirder rates like 20fps, the output is usually complete garbage - video 10 times too fast and whatnot. I posted a thread about this recently. As near as I can determine, this is a bug with yuvfps, which is the utility doing frame rate adjustment, but it may also just be because I am not using it properly. I found one possible solution, which was to use mencoder to do frame rate adjustment, output the video in raw form, then encode that using the script - but a few tests showed that even that wasn't very reliable (not to mention it produces gigantic intermediate files - raw video is something like 4GB for 20 minutes at VCD resolution).

So, I am still working on that. I have a bunch of video sitting around on my hard drive that I don't know what to do with because of this problem. If you manage to do any tinkering and come up with possible solutions, I would love to hear about them!
 
Old 10-03-2004, 09:18 PM   #37
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
alright, thx for checking. I'll try to look around and see what i find...
 
Old 10-08-2004, 04:33 AM   #38
Read_Icculus
Member
 
Registered: Oct 2002
Distribution: MDK 9.2, Debian
Posts: 74

Rep: Reputation: 15
Tried this script on multiple files and this is usually the result - mplayer kicks in fine and then I get this error (from encoding an AVI to full-screen VCD) -


Code:
Exiting... (End of file)
*********************************************************
Encoding WAV...
*********************************************************
   INFO: [mp2enc] Opened WAV file, freq = 48000 Hz, channels = 2, bits = 16
   INFO: [mp2enc] format = 0x1, audio length = 136668672 bytes
   INFO: [mp2enc] slots/frame = 731
   INFO: [mp2enc] frac SpF=0.429, tot bitrate=224 kbps, s freq=44.1 kHz
   INFO: [mp2enc] Fractional number of slots, padding required
   INFO: [mp2enc] System is little endian
   INFO: [mp2enc] Avg slots/frame = inf; b/smp = inf; br = inf kbps
   INFO: [mp2enc] Encoding with psychoacoustic model 2 is finished
   INFO: [mp2enc] The MPEG encoded output file name is "sealab.mpa"
*********************************************************
Multiplexing audio and video together...
*********************************************************
   INFO: [mplex] mplex version 2.2.1 ($Date: 2002/02/04 19:06:14 $)
**ERROR: [mplex] Unable to open file sealab.m1v for reading.
*********************************************************
Cleaning up...
*********************************************************
rm: cannot remove `sealab.m1v': No such file or directory
Done
Then on a bigger file trying to encode to SVCD I get this, (full output) -

Code:
--------------------------------
tovid video conversion script
Version 0.11
Written in 2004 by Eric Pierce
wapcaplet99@yahoo.com
--------------------------------
*********************************************************
Input file is 720 x 480 at 29.970 fps.
Source is 29.970 fps (NTSC). Leaving fps alone.
Scaling and/or padding with letterbox bars
Scaling full-screen aspect
*********************************************************
Creating and encoding video stream...
rm: cannot remove `stream.yuv': No such file or directory
The following command will be run to encode the video:
mplayer -nosound -noframedrop -noautosub -vo yuv4mpeg "outfoxed.avi" & cat stream.yuv | yuvscaler -O SVCD -v 0 -n n | nice -n 16 mpeg2enc -a 2 -f 4 -d -b 3600 -F 4 -v 0 -n n -H -o outfoxed.m2v
*********************************************************
MPlayer 1.0pre5-3.3.1 (C) 2000-2004 MPlayer Team

CPU: Intel Pentium 4/Xeon/Celeron Foster 2785 MHz (Family: 8, Stepping: 7)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
Reading config file /etc/mplayer/mplayer.conf
Reading config file /home/shane/.mplayer/config
Reading /home/shane/.mplayer/codecs.conf: Can't open '/home/shane/.mplayer/codecs.conf': No such file or directory
Reading /etc/mplayer/codecs.conf: 73 audio & 180 video codecs
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system startup scripts.
Using usleep() timing
Can't open input config file /home/shane/.mplayer/input.conf: No such file or directory
Input config file /etc/mplayer/input.conf parsed: 53 binds
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0 : No such file or directory
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support.
You will not be able to use your remote control.

Playing outfoxed.avi.
Cache fill:  0.00% (0 bytes)       INFO: [yuvscaler] yuvscaler (version 1.6.1) is a general scaling utility for yuv frames
   INFO: [yuvscaler] (C) 2001 Xavier Biquard <xbiquard@free.fr>
   INFO: [yuvscaler] yuvscaler -h for help, or man yuvscaler
Cache fill:  0.00% (0 bytes)    AVI file format detected.
AVI_NI: No audio stream found -> no sound.
VIDEO:  [DIVX]  720x480  24bpp  29.970 fps  548.5 kbps (67.0 kbyte/s)
Clip info:
 Software: MEncoder 1.0pre5-3.3.2
vo_yuv4mpeg: Using (default) progressive frame mode
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Audio: no sound
Starting playback...
mpeg2enc: invalid option -- H
--verbose|-v num
    Level of verbosity. 0 = quiet, 1 = normal 2 = verbose/debug
--format-f fmt
    Set pre-defined mux format fmt.
    [0 = Generic MPEG1, 1 = standard VCD, 2 = VCD,
     3 = Generic MPEG2, 4 = standard SVCD, 5 = user SVCD,
     6 = VCD Stills sequences, 7 = SVCD Stills sequences, 8 = DVD]
--aspect|-a num
    Set displayed image aspect ratio image (default: 2 = 4:3)
    [1 = 1:1, 2 = 4:3, 3 = 16:9, 4 = 2.21:1]
--frame-rate|-F num
    Set playback frame rate of encoded video
    (default: frame rate of input stream)
    0 = Display frame rate code table
--video-bitrate|-b num
    Set Bitrate of compress video in KBit/sec
    (default: 1152 for VCD, 2500 for SVCD, 3800 for DVD)
--nonvideo-birate|-B num
    Non-video data bitrate to assume for sequence splitting
    calculations (see also --sequence-length).
--quantisation|-q num
    Image data quantisation factor [1..31] (1 is best quality, no default)
    When quantisation is set variable bit-rate encoding is activated and
    the --bitrate value sets an *upper-bound* video data-rate
--output|-o pathname
    pathname of output file or fifo (REQUIRED!!!)
--vcd-still-size|-T size
    Size in KB of VCD stills
--interlace-mode|-I num
    Sets MPEG 2 motino estimation and encoding modes:
    0 = Progressive (non-interlaced)(Movies)
    1 = Interlaced source material (video)
--motion-search-radius|-r num
    Motion compensation search radius [0..32] (default 16)
--reduction-4x4|num
    Reduction factor for 4x4 subsampled candidate motion estimates
    [1..4] [1 = max quality, 4 = max. speed] (default: 2)
--reduction-2x2|-2 num
    Reduction factor for 2x2 subsampled candidate motion estimates
    [1..4] [1 = max quality, 4 = max. speed] (default: 3)
--min-gop-size|-g num
    Minimum size Group-of-Pictures (default 12)
--max-gop-size|-G num
    Maximum size Group-of-Pictures (default 12)
    If min-gop is less than  max-gop, mpeg2enc attempts to place GOP
    boundaries to coincide with scene changes
--force-b-b-p|-P
    Preserve two B frames between I/P frames when placing GOP boundaries
--quantisation-reduction|-Q num
    Max. quantisation reduction for highly active blocks
    [0.0 .. 5] (default: 0.0)
--video-buffer|-V num
    Target decoders video buffer size in KB (default 46)
--video-norm|-n n|p|s
    Tag output to suit playback in specified video norm
    (n = NTSC, p = PAL, s = SECAM) (default: PAL)
--sequence-length|-S num
    Place a sequence boundary in the video stream so they occur every
    num Mbytes once the video is multiplexed with audio etc.
    N.b. --non-video-bitrate is used to the bitrate of the other
    data that will be multiplexed with this video stream
--3-2-pulldown|-p
    Generate header flags for 3-2 pull down of 24fps movie material
--intra_dc_prec|-D [8..10]
    Set number of bits precision for DC (base colour) of blocks in MPEG-2
--reduce-hf|-N
    Reduce high frequency resolution - useful as a mild noise reduction
--keep-hf|-h
    Maximise high-frequency resolution - useful for high quality sources
    and/or high bit-rates)
--sequence-header-every-gop|-s
    Include a sequence header every GOP if the selected format doesn't
    do so by default.
--no-dummy-svcd-SOF|-d
    Don't generate of dummy SVCD scan-data for the ISO CD image
    generator "vcdimager" to fill in.
--playback-field-order|-z b|t
    Force setting of playback field order to bottom or top first
--multi-thread|-M num
    Activate multi-threading to optimise through on a system with num CPU's
    [0..32], 0=no multithreading, (default: 1)
--correct-svcd-hds|-C
    Force SVCD horizontal_display_size to be 480 - standards say 540 or 720
    But many DVD/SVCD players screw up with these values.
--no-altscan-mpeg2
    Force MPEG2 *not* to use alternate block scanning.  This may allow some
    buggy players to play SVCD streams
--help|-?
    Print this lot out!
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [yuv4mpeg] 720x480 => 720x540 Planar YV12  [zoom]
*********************************************************
Creating WAV of audio stream...
The following command will be run to encode the audio:
mplayer -vo null -ao pcm -aofile stream.wav "outfoxed.avi"
*********************************************************
MPlayer 1.0pre5-3.3.1 (C) 2000-2004 MPlayer Team

CPU: Intel Pentium 4/Xeon/Celeron Foster 2785 MHz (Family: 8, Stepping: 7)
Detected cache-line size is 64 bytes
CPUflags:  MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
Compiled with runtime CPU detection - WARNING - this is not optimal!
To get best performance, recompile MPlayer with --disable-runtime-cpudetection.
Reading config file /etc/mplayer/mplayer.conf
Reading config file /home/shane/.mplayer/config
Reading /home/shane/.mplayer/codecs.conf: Can't open '/home/shane/.mplayer/codecs.conf': No such file or directory
Reading /etc/mplayer/codecs.conf: 73 audio & 180 video codecs
Linux RTC init error in ioctl (rtc_irqp_set 1024): Permission denied
Try adding "echo 1024 > /proc/sys/dev/rtc/max-user-freq" to your system startup scripts.
Using usleep() timing
Can't open input config file /home/shane/.mplayer/input.conf: No such file or directory
Input config file /etc/mplayer/input.conf parsed: 53 binds
Opening joystick device /dev/input/js0
Can't open joystick device /dev/input/js0 : No such file or directory
Can't init input joystick
Setting up LIRC support...
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support.
You will not be able to use your remote control.

Playing outfoxed.avi.
Cache fill:  0.00% (0 bytes)    AVI file format detected.
VIDEO:  [DIVX]  720x480  24bpp  29.970 fps  548.5 kbps (67.0 kbyte/s)
Clip info:
 Software: MEncoder 1.0pre5-3.3.2
==========================================================================
Trying to force audio codec driver family libmad...
Opening audio decoder: [libmad] libmad mpeg audio decoder
AUDIO: 48000 Hz, 2 ch, 16 bit (0x10), ratio: 4000->192000 (32.0 kbit)
Selected audio codec: [mad] afm:libmad (libMAD MPEG layer 1-2-3)
==========================================================================
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffodivx] vfm:ffmpeg (FFmpeg MPEG-4)
==========================================================================
Checking audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
AF_pre: af format: 2 bps, 2 ch, 48000 hz, little endian signed int
AF_pre: 48000Hz 2ch Signed 16-bit (Little-Endian)
PCM: File: stream.wav (WAVE)
PCM: Samplerate: 48000Hz Channels: Stereo Format Signed 16-bit (Little-Endian)
PCM: Info: fastest dumping is achieved with -vc dummy -vo null
PCM: Info: to write WAVE files use -waveheader (default); for RAW PCM -nowaveheader.
AO: [pcm] 48000Hz 2ch Signed 16-bit (Little-Endian) (2 bps)
Building audio filter chain for 48000Hz/2ch/16bit -> 48000Hz/2ch/16bit...
Starting playback...
VDec: vo config request - 720 x 480 (preferred csp: Planar YV12)
VDec: using Planar YV12 as output csp (no 0)
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [null] 720x480 => 720x540 Planar YV12  [zoom]
A: 188.4 V: 188.6 A-V: -0.162 ct: -0.547  5653/5653   3%  0%  1.9% 2229 0 49%

           ************************************************
           **** Your system is too SLOW to play this!  ****
           ************************************************

Possible reasons, problems, workarounds:
- Most common: broken/buggy _audio_ driver
  - Try -ao sdl or use ALSA 0.5 or the OSS emulation of ALSA 0.9.
  - Experiment with different values for -autosync, 30 is a good start.
- Slow video output
  - Try a different -vo driver (-vo help for a list) or try -framedrop!
- Slow CPU
  - Don't try to play a big DVD/DivX on a slow CPU! Try -hardframedrop.
- Broken file
  - Try various combinations of -nobps -ni -forceidx -mc 0.
- Slow media (NFS/SMB mounts, DVD, VCD etc)
  - Try -cache 8192.
- Are you using -cache to play a non-interleaved AVI file?
  - Try -nocache.
Read DOCS/HTML/en/devices.html for tuning/speedup tips.
If none of this helps you, read DOCS/HTML/en/bugreports.html.
Cannot sync MAD frame: -0.083 ct:  0.020  139742/139742   4%  0%  2.0% 54653 0 49%
Cannot sync MAD frame
A:4662.9 V:4663.3 A-V: -0.432 ct: -0.010  139760/139760   4%  0%  2.0% 54653 0 0%

Exiting... (End of file)
/usr/local/bin/tovid: line 1:  7047 Broken pipe             mplayer -nosound -noframedrop -noautosub -vo yuv4mpeg "outfoxed.avi"
*********************************************************
Encoding WAV...
*********************************************************
   INFO: [mp2enc] Opened WAV file, freq = 48000 Hz, channels = 2, bits = 16
   INFO: [mp2enc] format = 0x1, audio length = 895269888 bytes
   INFO: [mp2enc] slots/frame = 731
   INFO: [mp2enc] frac SpF=0.429, tot bitrate=224 kbps, s freq=44.1 kHz
   INFO: [mp2enc] Fractional number of slots, padding required
   INFO: [mp2enc] System is little endian
   INFO: [mp2enc] Avg slots/frame = inf; b/smp = inf; br = inf kbps
   INFO: [mp2enc] Encoding with psychoacoustic model 2 is finished
   INFO: [mp2enc] The MPEG encoded output file name is "outfoxed.mpa"
*********************************************************
Multiplexing audio and video together...
*********************************************************
   INFO: [mplex] mplex version 2.2.1 ($Date: 2002/02/04 19:06:14 $)
**ERROR: [mplex] Unable to open file outfoxed.m2v for reading.
*********************************************************
Cleaning up...
*********************************************************
rm: cannot remove `outfoxed.m2v': No such file or directory
Done
Then the script just ends and there are no files besides the original AVI. The error about "system too slow" doesn't quite make sense to me, I've got a 2.8 ghz p4 with 512 RDRAM. Also puzzling to me is the "unrecognized option -H" for mpeg2enc. So far I haven't been able to get the script to work with any video file I've tossed at it with all the various options.

Thanks for any insight.
 
Old 10-08-2004, 10:08 AM   #39
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
weird. So far the only problems i have had with it are *.asf videos. Other than that it has been perfect. I have encoded maybe 4 avi files. Also, you say 'from encoding an AVI to full-screen VCD',but was the original avi full screen too? I don't think it can convert a widescreen to a full screen or vice versa.

Last edited by sk545; 10-08-2004 at 10:12 AM.
 
Old 10-08-2004, 12:45 PM   #40
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Original Poster
Rep: Reputation: 48
Read_Icculus: It looks as though the "-H" option is not supported in your version of mpeg2enc. In my version (1.6.2), "-H" is the same as "--keep-hf"; looking at your output, it appears that your version of mpeg2enc wants "-h" (lowercase). At any rate, that's why it's not producing any video file (the m1v or m2v file). I'll look into patching this. In the meantime, you can fix it by editing the script in your favorite text editor. Look for these lines (304 through 306):

Code:
VIDCOMMAND="mplayer -nosound -noframedrop -noautosub -vo yuv4mpeg $VIDFILTER \"$INFILE\" &  
cat stream.yuv | $ADJUSTFPS $ADJSIZE nice -n 16 mpeg2enc \
$ASPECTFMT $VIDFMT $VIDFPS -v 0 -n n -H -o $OUTPREFIX.$SUF"
In the third line, you can just remove the "-H" or change it to "-h" or "--keep-hf". The option is supposed to increase quality, but it will probably be fine without it. Don't worry about the "Your system is too slow" warning - I think that only applies if you're trying to watch the video in realtime, which is not an issue when encoding.

As for sk545's comment: I've designed the script to be able to handle widescreen input with fullscreen output. If you have a widescreen video (approx. 16:9 aspect) and request "full" output, the video will be padded with letterbox bars. At least, that's what it's supposed to do! I haven't tested it too much, so if you have problems with that, let me know. DVD supports widescreen output, so there's not much sense in using it with DVD, but VCD and SVCD must always be full-screen, so the letterboxing has to be done for those.
 
Old 10-08-2004, 04:42 PM   #41
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
cool. Thx for clarifying, i wasn't sure what it did exactly.

But, i guess the next 'easier' feature to implement would be to cut the resulting svcd, vcd mpegs into the proper sizes so they fit on a cd. There have been quite a few times where i run into that situation. Hopefully its easier to do, but what do i know.

Oh, and the problem that Read_Icculus had, is so typical with these scripts and is what i said in the beginning. Scripts die because of these problems.

Last edited by sk545; 10-08-2004 at 04:45 PM.
 
Old 10-08-2004, 11:38 PM   #42
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Original Poster
Rep: Reputation: 48
You're right, one of the problems with this program (and many others) is the lack of robustness. Differing versions of the constituent programs can cause failure if their syntax is even slightly different from the version I happen to use. The more feedback I get from you guys, the more easily I can spot and fix these problems.

I'm hesitant to make any significant improvements to the current script at the moment, because I would really prefer to revamp it entirely to allow for PAL encoding and the other options that have been suggested (such as output size restriction, DVD authoring, and so on). This script started as a couple of commands for converting from PAL to NTSC. At the beginning, a reckless hack worked, but it's getting complicated and unwieldy (not least because I've been learning bash scripting as I go). I've considered making the script and GUI a single program in Python; it could be run as GUI, or from the command-line as always, but that would introduce a limitation for those who don't have (or don't want) Python installed. A compiled language like C/C++ would be a possibility, but I'd prefer to keep it entirely in a script or interpreted language for ease of modification. At any rate, it's not something I've had the time to devote to lately, so the current script structure will probably stick around for a bit, until I can dedicate some time to the preliminary engineering and design I probably should have done in the first place.

I don't know how easy it would be to restrict the size to CD or DVD-size. Thus far, I've been under the assumption that the script would only be used for single video files, and that there would be multiple videos on each disc, so any size limits would have to be dealt with manually. As far as I know, there is no reliable way to predict the output size until the video is encoded; restricting the bitrate limits the absolute maximum possible size, but in practice videos don't often use the max bitrate (except for VCD, where the bitrate is constant). Probably some kind of estimation algorithm would help; encode a few seconds of video and check the resulting size to get an idea of required space. I'll consider it for future releases, but it's probably a long way off, unless you or another emboldened developer would like to help implement it.

I appreciate your suggestions, and all the feedback everyone in this thread has given me! Your interest has provided good incentive for me to continue improving the script.
 
Old 10-09-2004, 11:45 AM   #43
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
I see. Hrm, dunno if this will help, but i'll put it in anyways:
http://www.linuxquestions.org/questions/answers/262
Quote:
mplex -S 790 -f 4 -o filename.mpg filename.m1v filename.mp2 What this says is to remultiplex your two streams into filetype 4 (-f 4) which is SVCD, with output file (-o) called "filename.mpg". The "-S 790" tells it to split the created MPEG into files that will each fit on a CD. (-S means size, although I'm not sure what the units are, it's not megabytes, but 790 fits perfectly onto one standard blank CD). IIRC it adds a "1" or "2" or "3" after the filename if it has to split them... (-f 1 will tell it to make VCDs)
I know that your script does audio and video separately too, so that above *might* be an option.
 
Old 10-09-2004, 03:47 PM   #44
wapcaplet
Guru
 
Registered: Feb 2003
Location: Colorado Springs, CO
Distribution: Gentoo
Posts: 2,018

Original Poster
Rep: Reputation: 48
That's one option I didn't know about, but after investigating it, I'm afraid it's not a very good solution. It would split the file somewhat arbitrarily - you might end up with a movie that is split in mid-sentence - and the manual page for mplex says this option is not intended for splitting (S)VCDs into multiple discs, and will probably not even work for that purpose due to the split chunks lacking necessary parameters for (S)VCD playback.

Part of my eventual plan for authoring DVDs is to provide an easy way to locate and specify chapter breaks (I usually do it by watching the final video, skipping around to find good breakpoints, and noting chapter breaks in the dvdauthor XML specification - hardly an ideal solution), so perhaps that will lend viability to splitting in a reasonable spot. mpeg2enc (which does the video encoding) has the ability to insert sequence splits into an encoded video, which mplex can then use for the final result, so I will look into that.
 
Old 10-09-2004, 10:51 PM   #45
sk545
Member
 
Registered: Aug 2002
Posts: 312

Rep: Reputation: 30
Cool.

I also found these two tools:

http://mpgtx.sourceforge.net/ ( i think it only works for vcd's, well, actually it might work with svcd's too)

The other one is only gui, i think:

http://outflux.net/unix/software/GOPchop/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert AVI to either DVD, VCD or SVCD format linux-rulz Linux - General 13 12-27-2011 01:29 PM
XVID, VCD, SVCD and so on. How to?? Thakowbbery Suse/Novell 7 10-31-2005 03:39 PM
Encoding video for VCD and DVD wapcaplet LinuxQuestions.org Member Success Stories 3 08-01-2004 01:03 PM
SVCD, VCD, DVD editing asalford Linux - Software 19 07-16-2004 04:47 PM
converting *.avi file to *.vcd (or svcd) zstingx Linux - General 1 10-07-2003 06:44 AM


All times are GMT -5. The time now is 09:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration