You are not logged in.

#1 2007-11-25 17:27:54

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

[DONE] h264enc. a way to automate lot of files encoding

hi! i have a lot of vob and mpeg files i need to encode using h264enc... but i wanna see if there's a way to automate the process so i set everything up and let the computer do the job with all the files...

TNX in advance

Last edited by leo2501 (2008-01-25 23:20:49)


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#2 2007-11-25 17:32:45

FeatherMonkey
Member
Registered: 2007-02-26
Posts: 313

Re: [DONE] h264enc. a way to automate lot of files encoding

I noticed you're using h264enc if you look at the mencoder command at the end I can't see why you cant just use
something along the lines of
for i in /directory/* ; do mencoder command; done <== hopefully you get the gist, my bash is very noobish

Something like the above, or perhaps email the dev for the app you may find a favourable result. I find keeping it upto date is frequent.

Offline

#3 2008-01-25 23:17:58

leo2501
Member
From: Buenos Aires, Argentina
Registered: 2007-07-07
Posts: 658

Re: [DONE] h264enc. a way to automate lot of files encoding

Done! hope someone found it useful

i use it this way:
enc2h264 hq 96 700 file1.avi && enc2h264 hq 96 700 file2.avi && enc2h264 hq 96 700 file3.avi ...
because i dont want to compress every avi in my dir, only some wich i want to select big_smile

#!/bin/bash
#Encode to h264 script
#video codec: h264
#audio codec: mp3 ABR
#container: AVI
#usage: enc2h264 [preset: hq,vhq,uhq] [audiobitrate] [videobitrate] [filename]
#usage: enc2h264 hq 64 700 filename.avi
#usage: enc2h264 $1 $2 $3  $4
#
if [ "$1" = "hq" ]; then
mencoder "$4" -vf pp=ha:70:15/va/dr,harddup -oac mp3lame -lameopts abr:br="$2":aq=4:vol=2.2:mode=1:highpassfreq=0:lowpassfreq=0 -ovc x264 -x264encopts pass=1:crf=19:turbo=2:me=umh:me_range=19:nodct_decimate:nointerlaced:8x8dct:threads=auto:nofast_pskip:nobrdo:trellis=1:partitions=p8x8,b8x8,i8x8,i4x4:mixed_refs:bime:frameref=3:bframes=6:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=5:chroma_me:cabac:deblock -passlogfile /home/aleyscha/.h264enc/h264.log -o /dev/null && mencoder "$4" -vf pp=ha:70:15/va/dr,harddup -oac mp3lame -lameopts abr:br="$2":aq=4:vol=2.2:mode=1:highpassfreq=0:lowpassfreq=0 -ovc x264 -x264encopts pass=2:bitrate="$3":me=umh:me_range=19:nodct_decimate:nointerlaced:8x8dct:threads=auto:nofast_pskip:nobrdo:trellis=1:partitions=p8x8,b8x8,i8x8,i4x4:mixed_refs:bime:frameref=3:bframes=6:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=5:chroma_me:cabac:deblock -passlogfile /home/aleyscha/.h264enc/h264.log -o "$4_new.avi"
elif [ "$1" = "vhq" ]; then
mencoder "$4" -vf spp=2:0:0,harddup -oac mp3lame -lameopts abr:br="$2":aq=4:vol=2.2:mode=1:highpassfreq=0:lowpassfreq=0 -ovc x264 -x264encopts pass=1:crf=19:turbo=2:me=umh:me_range=24:nodct_decimate:nointerlaced:8x8dct:threads=auto:nofast_pskip:brdo:trellis=1:partitions=p8x8,b8x8,i8x8,i4x4:mixed_refs:bime:keyint=300:keyint_min=30:frameref=4:bframes=8:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=6:chroma_me:cabac:deblock -passlogfile /home/aleyscha/.h264enc/h264.log -o /dev/null && mencoder "$4" -vf spp=2:0:0,harddup -oac mp3lame -lameopts abr:br="$2":aq=4:vol=2.2:mode=1:highpassfreq=0:lowpassfreq=0 -ovc x264 -x264encopts pass=2:bitrate="$3":me=umh:me_range=24:nodct_decimate:nointerlaced:8x8dct:threads=auto:nofast_pskip:brdo:trellis=1:partitions=p8x8,b8x8,i8x8,i4x4:mixed_refs:bime:keyint=300:keyint_min=30:frameref=4:bframes=8:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=6:chroma_me:cabac:deblock -passlogfile /home/aleyscha/.h264enc/h264.log -o "$4_new.avi"
elif [ "$1" = "uhq" ]; then
mencoder "$4" -o /dev/null -vf softskip,harddup -oac mp3lame -lameopts abr:br="$2":aq=4:vol=2.2:mode=1:highpassfreq=0:lowpassfreq=0 -ovc x264 -x264encopts pass=1:crf=18:turbo=2:me=esa:me_range=64:nodct_decimate:nointerlaced:8x8dct:threads=auto:nofast_pskip:trellis=2:partitions=all:mixed_refs:bime:keyint=300:keyint_min=30:frameref=8:bframes=16:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=7:brdo:chroma_me:cabac:deblock:nossim:nopsnr -passlogfile /home/aleyscha/.h264enc/h264.log && mencoder "$4" -o "$4_new.avi" -vf softskip,harddup -oac mp3lame -lameopts abr:br="$2":aq=4:vol=2.2:mode=1:highpassfreq=0:lowpassfreq=0 -ovc x264 -x264encopts pass=2:bitrate="$3":me=esa:me_range=64:nodct_decimate:nointerlaced:8x8dct:threads=auto:nofast_pskip:trellis=2:partitions=all:mixed_refs:bime:keyint=300:keyint_min=30:frameref=8:bframes=16:b_adapt:b_pyramid:weight_b:direct_pred=auto:subq=7:brdo:chroma_me:cabac:deblock:nossim:nopsnr -passlogfile /home/aleyscha/.h264enc/h264.log
fi

Last edited by leo2501 (2008-01-25 23:22:09)


Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.
-- Antoine de Saint-Exupery

Offline

#4 2009-08-10 22:50:45

delacruz
Member
From: /home/houston
Registered: 2007-12-09
Posts: 102

Re: [DONE] h264enc. a way to automate lot of files encoding

i cant get this to work im trying to do an mkv file to an avi.

sh-4.0$ ./enc2h264.sh hq 192 922 george.mkv
MEncoder SVN-r29411-4.4.0 (C) 2000-2009 MPlayer Team
137 audio & 299 video codecs
Option x264encopts: Unknown suboption nobrdo
Option x264encopts: Unknown suboption bime
success: format: 0  data: 0x0 - 0x8be64c3a
[mkv] Track ID 1: audio (A_AC3), -aid 0, -alang und
[mkv] Track ID 2: video (V_MPEG4/ISO/AVC), -vid 0
[mkv] Will play video track 2.
Matroska file format detected.
VIDEO:  [avc1]  1280x720  24bpp  29.970 fps    0.0 kbps ( 0.0 kbyte/s)
[V] filefmt:31  fourcc:0x31637661  size:1280x720  fps:29.970  ftime:=0.0334
==========================================================================
Opening audio decoder: [liba52] AC3 decoding with liba52
Using SSE optimized IMDCT transform
Using MMX optimized resampler
AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
Selected audio codec: [a52] afm: liba52 (AC3-liba52)
==========================================================================
Opening video filter: [expand osd=1]
Expand: -1 x -1, -1 ; -1, osd: 1, aspect: 0.000000, round: 1
Opening video filter: [harddup]
Opening video filter: [pp=ha:70:15/va/dr]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
MP3 audio selected.
Pos:   0.0s      1f ( 0%)  0.00fps Trem:   0min   0mb  A-V:0.000 [0:0]
1 duplicate frame(s)!
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
Writing header...
ODML: Aspect information not (yet?) available or unspecified, not writing vprp header.
VDec: vo config request - 1280 x 720 (preferred colorspace: Planar YV12)
[PP] Using external postprocessing filter, max q = 6.
VDec: using Planar I420 as output csp (no 1)
Movie-Aspect is 1.78:1 - prescaling to correct movie aspect.
FATAL: Cannot initialize video driver.

Exiting...
sh-4.0$

Offline

Board footer

Powered by FluxBB