Hexdump: Hexdump a binary file and convert it back

Hi,

for hexdump (binary) files and converting back the Linux command line xxd works perfect.

More »

Advertisment to support michlstechblog.info

Hyper-V: Convert a VMware Virtual Machine files to Hyper-V

Hi,

this post describes how to convert VMware vmdk files to Hyper-V’s vhdx format.

More »

Windows: Convert formatted text in clipboard to plain text

Hi,

when you often have to copy some text between HTML/Browser pages, browser based content management systems, Office Documents and terminal emulators you know the problem: Text from browsers and office documents also contains format attributes like font size, fonts etc. which causes an unexpected layout or format.

For example, if you copy a text from LibreOffice to wordpress(Yes of course, you could paste the test  into wordpress by using the “paste plain text” toolbar buttons. But this is one step more and I prefer Ctrl V Ctrl C for copy and paste).
More »

Linux: Some ffmpeg command line examples

Hi,

here are a list of some command line examples for converting audio and video files with ffmpeg. ffmpeg is part of the most linux distributions but there is also a Windows version available.

Convert ogg to mp3, with -a you can specify some audio options here a bitrate of 192k
ffmpeg -i input.ogg -ab 192k output.mp3
To remove the embedded cover(Cover is saved as Video Stream)

ffmpeg -i input.mp3 -vn -ab 192k output.mp3
To remove cover and copy the audio stream, no remux is done => better quality
ffmpeg -i input.mp3 -y -map 0:a -codec:a copy -map_metadata -1 output.mp3

Covert a MKV container to avi. 2 Steps required.

Step 1 (h264 -> mpeg4)

ffmpeg -i video.mkv -qscale 0 -acodec copy temp.avi

and Step 2

ffmpeg -i temp.avi -vcodec mpeg4 -b 4000k -acodec mp2 -ab 320k output.avi

MPEG4 to xvid Bitrate 1200kb half resolution, AC3 to mp3 128kb
ffmpeg -i temp.avi -vf scale=iw/2:-1 -b 1200k -q:v 2 -q:a 2 -c:v libxvid  -c:a libmp3lame -b:a 128k output.avi
Another simple way to xvid
ffmpeg -i input.avi -c:v mpeg4 -vtag xvid output.avi
MKV to xvid 4:3
ffmpeg -i input.mkv -sn -c:a libmp3lame -ar 48000 -ab 128k -ac 2 -c:v libxvid -crf 24 -vtag DIVX -vf scale=640:480 -aspect 4:3 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 30 -vb 1500k output.avi
MKV to xvid 16:9
ffmpeg -i input.mkv -sn -c:a libmp3lame -ar 48000 -ab 128k -ac 2 -c:v libxvid -crf 24 -vtag DIVX -vf scale=720:480 -aspect 16:9 -mbd rd -flags +mv4+aic -trellis 2 -cmp 2 -subcmp 2 -g 30 -vb 1500k output.avi
Format to play on some DVD Player with SDCard (Medion for example)
ffmpeg -i input.mkv -f avi -c:v libxvid -qscale:v 2 -vf scale=512x280 -c:a libmp3lame -b:a 320k output.avi
and with a limited bitrate
ffmpeg -i input.mkv -f avi -c:v libxvid -b:v 1M -maxrate 1M -bufsize 1M -vf scale=512x280 -c:a libmp3lame -b:a 320k output.avi
Scale to a specific resolution and preserve aspect ration
ffmpeg -i temp.avi -vf scale=320:-1 output_320.avi

Concat 2 files with the same codec. Create a list of video files and write it to file

cat movlist.txt
file 'movPart1.avi'
file 'movPart2.avi'
ffmpeg -f concat -i movlist.txt -c copy mov.avi

 
Same but with mp3 files, Metadata are used from mp3File1.mp3

ffmpeg -i "concat:mp3File1.mp3|mp3File2.mp3" -acodec copy mp3file.mp3

Export Metadata from an mp3 file

ffmpeg -i mp3File1.mp3 -f ffmetadata mp3File1.metadata

With new metadata

ffmpeg -i "concat:mp3File1.mp3|mp3File2.mp3" -metadata "title=My Heavy Song" -metadata "artist=Metalartist" -metadata "album=Best Metal Album ever" -acodec copy mp3file.mp3 -vn

 

To be continued

Michael

Powershell: Error while calling the SaveAs Method of some Office Applications

Hi,

if you tried to save a word or excel document as another format you got an error. For example, if you want to convert a CSV File to a Excel workbook and save it in Excel 95/97/2003 format.

[reflection.assembly]::LoadWithPartialName("Microsoft.Office.InterOp.Excel")
$oExcel = New-Object -ComObject "Excel.Application"
$sCSVFile="D:\temp\ImportFile.csv"
$oExcel.Visible = $true
$oCSVWorkbook=$oExcel.Workbooks.Add()
$oExcel.Workbooks.OpenText($sCSVFile)
$oCSVWorkbook.SaveAs("D:\temp\test.xls",[Microsoft.Office.Interop.Excel.XlFileFormat]::xlExcel9795)
Exception calling "SaveAs" with "1" argument(s): "SaveAs method of Workbook class failed"
At D:\test\CSV2Excel.ps1:29 char:20
+ $xl_workbook.SaveAs <<<< ("D:\Temp\test.xls")
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ComMethodTargetInvocation

More »

Original Theme by Schiy · Powered by WordPress