bidmead
10th May 2008, 01:52
A little bit of background: I'm using the Archos TV+ box as a source of TV recording for my home cinema network. The Archos TV+ records to DiVX, single pass, 2500Kbps, with 4-bit ADCPM sound (don't ask!), resulting in large (2GBish) files. Well, actually the Archos TV+ in its wisdom splits the files at around 1GB, but I can generally join them up (with VirtualDub) without any dropped frames. The result of this process creates a large OpenDML AVI container for the original DiVX and ADCPM streams.
To remove ads and generally clean up I transcode these files via AviSynth with scripts that look something like this, at their simplest:
AVISource("D:\Assemblies\A Man Apart\A Man Apart.VM-A.avi")
Trim(316, 173038)
Dissolve(Trim(0, 30100) , Trim(37025, 172722), 25)
Dissolve(Trim(0, 66726) , Trim(73652, 165773), 25)
Dissolve(Trim(0, 100701) , Trim(107627, 158823), 25)
I've been successfully feeding the output from this into a DOS script based around 2-pass ffmpeg accessed through the Windows XP SendTo mechanism. The gotcha with ffmpeg is that it automatically outputs into an ODML AVI when the output file gets bigger than around 1GB. An ODML container will play fine with my Pinnacle ShowCenter until, typically, the last couple of minutes, when the movie will abruptly abort. The solution is to ensure the container is always AVI 1 -- but I haven't found a way of guaranteeing that with ffmpeg.
So I'm trying to switch to mencoder, which has the -noodml option. Unforch, there's a different big gotcha with mencoder. An AVS script like the one above does the first pass just fine, but at the very end of that pass mencoder hangs and won't go on to the second pass.
By minimalising the mencoder script down to a single pass, barebones implementation I've discovered that what's causing the hang is that large AVISource input file originating from the Archos TV+ box. Smaller input files don't have this problem. I've tried using AVIFileSource and OpenDMLSource instead of AVISource, but this doesn't help. It seems that AVISource isn't closing the input file at the end of pass 1, and for some reason this is keeping mencoder from closing the output file. Mencoder doesn't exit, and retains its lock on the output file. You'll wait forever for a second pass when mencoder's in this mood... :-)
A workaround is to use DirectShowSource for the AVI input file, but I'm not too happy with this, particularly as I'm not 100 per cent sure what's actually going on here.
Here's my mencoder script, stripped right down to single pass to highlight the problem:
@echo off
rem chb 9-May-08
set ENCODER="C:\Program Files\MediaCoder\codecs\mencoder.exe"
set RENAME="mencoder.4.2.2@999"
set PASS1OUT="%~dp1%~n1.%RENAME%.avi"
rem PASS1OUT=nul.avi
%ENCODER% %1 -ovc lavc -oac lavc -ffourcc XVID -o %PASS1OUT%
pause
exit
If the AVS script is using AVISource, as above, the mencoder script runs, produces a valid output file, but then hangs, without arriving at the pause prompt. (It also hangs -- without, obviously, producing an output file if you substitute nul.avi as the output).
But if you use DirectShowSource in the AVS script men, the script merrily reaches the pause prompt and all will run smoothly into a second pass (haven't put that together yet, but I'm sure it will).
Can anyone shed any light on why AVISource is stopping the show here?
--
Chris
To remove ads and generally clean up I transcode these files via AviSynth with scripts that look something like this, at their simplest:
AVISource("D:\Assemblies\A Man Apart\A Man Apart.VM-A.avi")
Trim(316, 173038)
Dissolve(Trim(0, 30100) , Trim(37025, 172722), 25)
Dissolve(Trim(0, 66726) , Trim(73652, 165773), 25)
Dissolve(Trim(0, 100701) , Trim(107627, 158823), 25)
I've been successfully feeding the output from this into a DOS script based around 2-pass ffmpeg accessed through the Windows XP SendTo mechanism. The gotcha with ffmpeg is that it automatically outputs into an ODML AVI when the output file gets bigger than around 1GB. An ODML container will play fine with my Pinnacle ShowCenter until, typically, the last couple of minutes, when the movie will abruptly abort. The solution is to ensure the container is always AVI 1 -- but I haven't found a way of guaranteeing that with ffmpeg.
So I'm trying to switch to mencoder, which has the -noodml option. Unforch, there's a different big gotcha with mencoder. An AVS script like the one above does the first pass just fine, but at the very end of that pass mencoder hangs and won't go on to the second pass.
By minimalising the mencoder script down to a single pass, barebones implementation I've discovered that what's causing the hang is that large AVISource input file originating from the Archos TV+ box. Smaller input files don't have this problem. I've tried using AVIFileSource and OpenDMLSource instead of AVISource, but this doesn't help. It seems that AVISource isn't closing the input file at the end of pass 1, and for some reason this is keeping mencoder from closing the output file. Mencoder doesn't exit, and retains its lock on the output file. You'll wait forever for a second pass when mencoder's in this mood... :-)
A workaround is to use DirectShowSource for the AVI input file, but I'm not too happy with this, particularly as I'm not 100 per cent sure what's actually going on here.
Here's my mencoder script, stripped right down to single pass to highlight the problem:
@echo off
rem chb 9-May-08
set ENCODER="C:\Program Files\MediaCoder\codecs\mencoder.exe"
set RENAME="mencoder.4.2.2@999"
set PASS1OUT="%~dp1%~n1.%RENAME%.avi"
rem PASS1OUT=nul.avi
%ENCODER% %1 -ovc lavc -oac lavc -ffourcc XVID -o %PASS1OUT%
pause
exit
If the AVS script is using AVISource, as above, the mencoder script runs, produces a valid output file, but then hangs, without arriving at the pause prompt. (It also hangs -- without, obviously, producing an output file if you substitute nul.avi as the output).
But if you use DirectShowSource in the AVS script men, the script merrily reaches the pause prompt and all will run smoothly into a second pass (haven't put that together yet, but I'm sure it will).
Can anyone shed any light on why AVISource is stopping the show here?
--
Chris