|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
If the shell is bash:
${i/%mts/avi} will give you the name in $i with the trailing mts changed to avi. The % specifies trailing, without it the first match is used, so you will get a surprise with a name like high-mts.mts. Oh, and enclose $i and that expression in double quotes so that possible spaces in the filename won't wreck your script. |
|
||||
|
xvidenc/h264enc/divxenc can do directory batch encodings (choose as input type "dir") and since you're already an xvidenc & h264enc user, I recommend you try it. In batch mode, it will encode all files from the directory you give it with the settings you choose applied to all files
__________________
My site: http://microchip.bplaced.net My repo: http://download.opensuse.org/repositories/home:/microchip8 SUSE Unbound Forum: http://suseunbound.lefora.com Do coders dream of sheep() ? |
|
||||
|
Quote:
__________________
My site: http://microchip.bplaced.net My repo: http://download.opensuse.org/repositories/home:/microchip8 SUSE Unbound Forum: http://suseunbound.lefora.com Do coders dream of sheep() ? |
|
||||
|
Quote:
Quote:
Thanks !! |
|
||||
|
Quote:
I did try the raw .mts files with the h264enc and xvidenc scripts, and for some reason they can not handle the format for encoding. Possibly a Packman packaged mplayer/mencoder limitation? I can only "play" the files with mplayer if I specify the frame rate. ie I can get both audio and video with: Code:
mplayer 00017.mts -fps 25 Code:
mplayer 00017.mts Some of the h264enc errors look like this .... (using: "h264enc -2p -p uhq" ) after the first pass: Code:
Flushing video frames. Writing index... Writing header... ODML: vprp aspect is 16:9. Video stream: nan kbit/s (-2147483648 B/s) size: 0 bytes 0.000 secs 215 frames Audio stream: 139.609 kbit/s (17451 B/s) size: 8935 bytes 0.512 secs x264 [info]: final ratefactor: 14.09 Code:
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264) ========================================================================== Skipping frame! VDec: vo config request - 1920 x 1080 (preferred colorspace: Planar YV12) VDec: using Planar I420 as output csp (no 1) Movie-Aspect is 1.78:1 - prescaling to correct movie aspect. SwScaler: reducing / aligning filtersize 31 -> 16 SwScaler: reducing / aligning filtersize 31 -> 16 SwScaler: reducing / aligning filtersize 31 -> 14 SwScaler: reducing / aligning filtersize 31 -> 14 [swscaler @ 0x886caa0]Bicubic spline scaler, from yuv420p to yuv420p using MMX2 [swscaler @ 0x886caa0]using n-tap MMX scaler for horizontal luminance scaling [swscaler @ 0x886caa0]using n-tap MMX scaler for horizontal chrominance scaling [swscaler @ 0x886caa0]using n-tap MMX scaler for vertical scaling (YV12 like) [swscaler @ 0x886caa0]1920x1080 -> 1280x720 x264 [info]: using SAR=1/1 x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 FastShuffle SSE4.1 Cache64 x264 [error]: empty stats file x264_encoder_open failed. FATAL: Cannot initialize video driver. Exiting... -> MEncoder has exited with a non-zero value! -> Exiting in function: mencoder_exit() My apologies for not mentioning this to you earlier, .... But with my upcoming vacation, business trips, and all sorts of things to do on the home/family front, I did not want to "impose" on you by bring it up as I was not clear on my available time to support iterative testing. Fortunately the packman packaged ffmpeg CAN handle the format. I probably need to post a sample raw .mts file (from my Camcorder) on the web, for you to download and check out (in case you are curious). It would be neat if your scripts could handle the raw Canon HF S10 video format, but again, I do not want to impose ... |
|
||||
|
yes, samples would be good. I suspect that either your CAM is producing broken/incorrect file or there's something with mencoder/mplayer going on.. you can still force fps with mencoder and see if it'll encode it then... but samples will be good for me so I can test with them
__________________
My site: http://microchip.bplaced.net My repo: http://download.opensuse.org/repositories/home:/microchip8 SUSE Unbound Forum: http://suseunbound.lefora.com Do coders dream of sheep() ? |
|
||||
|
To finish this thread (apologies for not posting the code I eventually ended up using) - for a mass conversion to 1280x720 at a reasonably high bit rate, I use the following:
Code:
for i in *.mts; do ffmpeg -y -i "$i" -f avi -vcodec mpeg4 -b 8000000 -acodec ac3 -ab 128000 -s 1280x720 2009_06_21_${i/%mts/avi}; done
|
|
||||
|
Just a further update to this thread.
After a company function, in order to share the videos I took, I converted all of my videos to 3 different formats: DVD, SVCD, and VCD compatible. The command lines to do that were all very similar:
|
|
||||
|
Just another thankyou to microchip and ken_yap for your hints in this thread.
I was able to use that technique to launch a neat one line job to stabilize many dozens of my home video clips using VirtualDub under wine, with the deshaker plugin. The command line I used is in this thead: openSUSE Forums - View Single Post - KDENlive from Packman? I would have posted it here, but did not want to be accused of "double posting". ... Now a weakness of all Linux NLE is they do not have stabilization software. Hence being able to stabilize one's home videos with a legally free windoze app running under wine is the next best thing. And indeed VirtualDub with deshaker plugin, after some tuning/head-scratching, now works well for the limited set of codecs I have set it up for. My Intel Core i7 920 has never worked so hard, as my % CPU is running around 300% as it is very busy stabilizing many video clips. |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|