Post subject: Now I can't encode at all.
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Damn, I'm getting tired of all these encoding problems. Here it is. I'm trying to make an HD and SD encodes from the same movie, but it results of totally broken files that can't even be read. Even YouTube can't process the HD encode! Here are my testing files, you can check them out: http://www.mediafire.com/?4433y9suiae2h And here are the AviSynth and batch scripts I used to encode these files. HD encoding AVS script
a = AVISource("movie.avi").ConvertToRGB32()
#ar = a.PointResize(a.width * 4, a.height * 4)
ar = hq4x(a)
abottom = Crop(a, 0, 192, 256, 192)
#abottomr = abottom.PointResize(abottom.width * 8, abottom.height * 8)
abottomr = hq2x(hq4x(abottom))
b = Trim(StackHorizontal(ar, abottomr), 0, 900)
d = ImageSource(file="logohd.png", start=0, end=119, fps=b.FrameRate).ConvertToRGB32()
e = BlankClip(d, audio_rate=44100, channels=2)
f = AudioDub(d, e).Lanczos4Resize(b.width, b.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
last = f + b
AssumeFieldBased.Weave.VerticalReduceBy2
ConvertToYV24(chromaresample="point")
ConvertToYV12(chromaresample="point")
return last
SD encoding AVS script
framerate = 60
framestdebut = 120

titrejeu = """Magnetica "Challenge Mode (Hard)""""
auteur = "Mister Epic"
temps = "04:22.14"
rerecords = "1066"

tailletexte = 20

source = AVISource("movie.avi").ConvertToRGB24()

a1 = Crop(source, 0, 0, 256, 192)
a2 = Crop(source, 0, 192, 256, 192)

a = Trim(StackHorizontal(a1, a2), 0, 900)
b = ImageSource(file="logo.png", start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
c = BlankClip(b, audio_rate=44100, channels=2)
d = AudioDub(b, c).Lanczos4Resize(c.width, c.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
last = d + a
Subtitle(titrejeu + "\nPlayed by " + auteur + "\nPlaying time: " + temps + "\nRerecord count: " + rerecords, y=0, align=8, first_frame=framestdebut, last_frame=(framestdebut + (5 * framerate) - 1), size=tailletexte, font="TF2 Secondary", text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
Subtitle("This is a tool-assisted recording.\nFor details, visit http://TASVideos.org/", y=0, align=8, first_frame=(framestdebut + (5 * framerate)), last_frame=(framestdebut + (2 *(5 * framerate)) - 1), size=tailletexte, font="TF2 Secondary", text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
ConvertToYV24(chromaresample="point")
ConvertToYV12(chromaresample="lanczos4")
HD encoding batch script
flac -8 encoded.wav
x264.exe --qp 15 -b 0 --keyint 30 --output encodedhd.mp4 hdencode.avs
mkvmerge --engage no_simpleblocks -o encodingtestHD.mkv encodedhd2.mp4 encoded.flac
SD encoding batch script
neroAacEnc -q 0.25 -if encoded.wav -of encoded.aac
MP4Box -info encoded.aac
echo Supprimer excedant
pause
neroAacEnc -q 0.25 -if encoded.wav -of encoded.aac
x264 --crf 20 --deldup 0.1:0.1:100:1:0.1 --keyint 600 --ref 16 --no-fast-pskip --bframes 16 --b-adapt 2 --direct auto --me tesa --merange 64 --subme 10 --trellis 2 --partitions all --fullrange on --rc-lookahead 250 --no-dct-decimate -o encoded.mp4 sdencode.avs
MP4Box -add encoded.mp4 -add encoded.aac -par 1=1:1 -new encodingtestSD.mp4
You can ignore those echos and those # in those scripts. I've also tried these:
    Encoding without HQ2X and HQ4X for the HD encode Encoding without Flygon's interleaving trick for the HD encode Encoding without cropping and putting the screens side-to-side for the SD encode Using the latest version of x264 (direct264), because I could see that only the video track is buggy (by trying to read the unmuxed MP4) Using the x264 (direct264) version that was right under the latest Using "--me umh" instead of "--me tesa" Using the latest version of MKVMerge and MP4Box Restarting my computer
And I did some of them multiple times. All of these without success. Is there something I'm doing wrong?
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
This is what I get once I read those files in the latest MPlayer. SD encode results
MPlayer Sherpya-SVN-r32198-4.2.5 (C) 2000-2010 MPlayer Team
159 audio & 354 video codecs

Playing encodingtestSD.mp4.
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  512x192  24bpp  59.826 fps  -513651.6 kbps (-62701.6 kbyte/s)
Clip info:
 major_brand: isom
 minor_version: 1
 compatible_brands: isom
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
AUDIO: 44100 Hz, 2 ch, s16le, 61.5 kbit/4.36% (ratio: 7688->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [dsound] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
Movie-Aspect is 2.67:1 - prescaling to correct movie aspect.
VO: [directx] 512x192 => 512x192 Planar YV12 


Exiting... (End of file)
But the movie file plays as fast as hell and there was no sound. HD encode
MPlayer Sherpya-SVN-r32198-4.2.5 (C) 2000-2010 MPlayer Team
159 audio & 354 video codecs

Playing encodingtestHD.mkv.
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (flac), -aid 0
VIDEO:  [H264]  3072x1536  0bpp  29.913 fps    0.0 kbps ( 0.0 kbyte/s)
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
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.
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.
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.
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.
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.
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.
AUDIO: 44100 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->176400)
Selected audio codec: [ffflac] afm: ffmpeg (FFmpeg FLAC audio)
==========================================================================
AO: [dsound] 44100Hz 2ch s16le (2 bytes per sample)
Starting playback...
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.
Movie-Aspect is 2.00:1 - prescaling to correct movie aspect.
VO: [directx] 3072x1536 => 3072x1536 Planar YV12 
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.
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.
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.
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.
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.
...(This continues for a large amount)...
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.


Exiting... (End of file)
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Never mind, now it works. direct264 was the problem. So, I've downloaded the latest x264 to use it instead. For SD encoding, I will use Ilari's NHMLFixup Lua script. And I can encode in HD with all the filters I want to use.
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Just a quick note about your HD encoding scripts, I suggest changing the qp to 0. YouTube can now process lossless encodes and they compress surprisingly well with upscaled media.
GabCM
He/Him
Joined: 5/5/2009
Posts: 901
Location: QC, Canada
Flygon wrote:
Just a quick note about your HD encoding scripts, I suggest changing the qp to 0. YouTube can now process lossless encodes and they compress surprisingly well with upscaled media.
I'll remember that!
Banned User, Former player
Joined: 3/10/2004
Posts: 7698
Location: Finland
Was it really necessary to post that many repeated lines? You could have cut the excessive lines and replaced them with a note telling that there were lots of the same line repeated.
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
I've been trying to do the encoding HD and happened this:
avs [error]: StackHorizontal: image heights don't match
(hdencode.avs, line 7)
x264 [error]: could not open input file `hdencode.avs'
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
Can we see the script you are using? It would help us with troubleshooting.
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
This is the script that I use the batch that used
a = AVISource("movie.avi").ConvertToRGB32()
#ar = a.PointResize(a.width * 4, a.height * 4)
ar = hq4x(a)
abottom = Crop(a, 0, 192, 256, 192)
#abottomr = abottom.PointResize(abottom.width * 8, abottom.height * 8)
abottomr = hq3x(hq3x(abottom))
b = Trim(StackHorizontal(ar, abottomr), 0, 900)
d = ImageSource(file="logohd.png", start=0, end=119, fps=b.FrameRate).ConvertToRGB32()
e = BlankClip(d, audio_rate=48000, channels=1)
f = AudioDub(d, e).Lanczos4Resize(b.width, b.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
last = f + b
AssumeFieldBased.Weave.VerticalReduceBy2
ConvertToYV24(chromaresample="point")
ConvertToYV12(chromaresample="point")
return last
The command for the audio work for me, but this is the problem, I think
x264.exe --qp 15 -b 0 --keyint 30 --output encodedhd.mp4 hdencode.avs
I'm trying to use for encode this submission: Mendel Palace
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
If I'm reading that script correctly, it looks like you're trying to adapt an HQx encoding script originally used for the DS for use here. Needless to say it doesn't look like that works very well. Assuming I'm correct there, here is an adaptation of some of the bits and pieces of that script to the new version of the HD encoding script I am putting together (this requires the PointSize plugin available here):
Language: avs

LoadPlugin("PointSize.dll") a = AVISource("movie.avi").AssumeFieldBased.Weave.VerticalReduceBy2 b = (a.height > 540) ? a : \ (a.height > 270) ? hq2x(a) : \ (a.height > 180) ? hq3x(a) : hq4x(a) c = b.PointResize(b.height * 4 / 3, b.height) d = hq2x(c) e = ImageSource(file="logohd.png", start=0, end=59, fps=d.FrameRate).ConvertToRGB32() f = BlankClip(e, audio_rate=a.AudioRate, channels=a.AudioChannels) g = AudioDub(e, f).Lanczos4Resize(d.width, d.height).AssumeFPS(d.FrameRateNumerator, d.FrameRateDenominator) last = g + d ConvertToYV24(chromaresample="point") ConvertToYV12(chromaresample="point")
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
I've been looking at the page of High Definition (recently edited by sgrunt). And I realized that something was missing, the audio.wav. A I mean, it does not say how to extract the audio file, even tells how to encode the file. And then I me dizzy a lot because I have tried to extract the video in some way, but I can not. Not if I have to combine video logo and the movie to extract
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
It works exactly the same way as with regular encodes; for example, you can open the .avs with VirtualDub and use File -> Save .WAV.
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
Thanks sgrunt. I had no idea of open the file .avs in VirtulaDud
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
I have finished the coding and use an example of TAS. As Sonic 2 without Spindash. Not really went very well, but I'll give you the encoding .mkv and .mp4 (instead of encoding with audio.flac, use audio.aac to encode. And turned perfect) HD Encode in MP4 Link to video Archive collection Archive mp4 Archive mkv
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
If I might say so, it might be prudent to make a higher resolution logo for your HD encodes (something sufficiently large in a 4:3 aspect ratio - say, 2048x1536 or so - would probably be sufficient). You could also try just using the .wav directly for audio, if you don't mind the extra disk space the encode would take up.
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
Could serve if I may be proved necessary, but thanks for your advice
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
I have a problem for encode in SD with VirtualDud
Avisynth open failure
Splice: Frame sizes don't match
C:\Users\Marks\Desktop\TAS Encodings\SD\sdencode.avs, line 21)
That is happening to when I want encode Legend of Zelda. Do not understand why they do not match
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
sgrunt
He/Him
Emulator Coder, Former player
Joined: 10/28/2007
Posts: 1360
Location: The dark horror in the back of your mind
Please show us the script you are using.
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
Oh sorry, I always forget about it, here this
LoadPlugin("DeDup.dll")
framerate = 60.1
framestdebut = 120

titrejeu = """Legend of Zelda"""
auteur = "Baxter & jprofit22"
temps = "22:38.13"
rerecords = "33531"

tailletexte = 20

a = AVISource("movie.avi").ConvertToRGB24()
b = ImageSource(file="logo.png", start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
c = BlankClip(b, audio_rate=48000, channels=1)
d = AudioDub(b, c).Lanczos4Resize(c.width, c.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
last = d + a 
Subtitle("Legend of Zelda.\nPlayed by Baxter & jprofit22\nPlaying time: 22:38.13\nRerecord count: 33531", y=0, align=8, first_frame=115, last_frame=355, size=13.0, text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
Subtitle("This is a tool-assisted recording.\nFor details, visit http://TASVideos.org/", y=98, align=2, first_frame=356, last_frame=586, size=15.0, text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
ConvertToYV24(chromaresample="point")
ConvertToYV12(chromaresample="lanczos4")
DupMC(log="dup.txt")
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
LoadPlugin("DeDup.dll")
framerate = 60.1
framestdebut = 120

titrejeu = """Legend of Zelda"""
auteur = "Baxter & jprofit22"
temps = "22:38.13"
rerecords = "33531"

tailletexte = 20

a = AVISource("movie.avi").ConvertToRGB24()
f = a.PointResize(a.width * 1, a.height * 1)
b = ImageSource(file="logo.png", start=0, end=119, fps=a.FrameRate).ConvertToRGB24()
c = BlankClip(b, audio_rate=48000, channels=1)
d = AudioDub(b, c).Lanczos4Resize(f.width, f.height).AssumeFPS(a.FrameRateNumerator, a.FrameRateDenominator)
last = d + f 
Subtitle("Legend of Zelda.\nPlayed by Baxter & jprofit22\nPlaying time: 22:38.13\nRerecord count: 33531", y=0, align=8, first_frame=115, last_frame=355, size=13.0, text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
Subtitle("This is a tool-assisted recording.\nFor details, visit http://TASVideos.org/", y=98, align=2, first_frame=356, last_frame=586, size=15.0, text_color=$30FFFFFF, halo_color=$00000000, lsp=1)
ConvertToYV24(chromaresample="point")
ConvertToYV12(chromaresample="lanczos4")
DupMC(log="dup.txt")
Try this. This sets the logo to automatically resize to the AVI's size.
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
YES, works. Now I will continue on with the coding Thanks...
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks
Joined: 11/4/2007
Posts: 1772
Location: Australia, Victoria
Always glad to help successfully. For the uncertain, I just simply added a resizer into the script that... resizes into the same resolution (Don't ask why it's needed, it just needs it to work), and then resizes the logo into the 'resized' AVI's size. This works very well with HD logos, SD logos tend to be more noticeably distorted. It also allows you to only require a single PNG logo for every single television based console, since the aspect corrector in the MKV should stretch the logo to what it used to be anyway.
Banned User, Player (142)
Joined: 8/30/2010
Posts: 500
Location: Argentina Bs. As.
Flygon wrote:
This works very well with HD logos, SD logos tend to be more noticeably distorted.
If this will serve me, I think that would help me
[18:51] <scrimpy> Oh, nothing [18:51] <mmarks> oh [18:51] <Nach> I think scrimpy is just jealous of you mmarks