Hi,
Ich schreibe hier den Output vom mediainfo in ne Datei mit Namen mediainfo.log
Nun will ich aus dieser Datei alle Zeilen die mit Format beginnen ausgeben oder besser gesagt nur das dritte Feld dieser Zeilen.
Die mediainfo.log sieht so aus;
Code
General
Unique ID : 49193976013214200533114482053937751622 (0x25026A472FF179000182D2DE1C51E646)
Complete name : /home/xubuser/Schreibtisch/workdir/video/tmp_movie/mkv/Rush_Hour.mkv
Format : Matroska
Format version : Version 2
File size : 3.08 GiB
Duration : 1h 33mn
Overall bit rate : 4 704 Kbps
Writing application : HandBrake 0.9.8
Writing library : libmkv 0.6.5
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : V_MPEG4/ISO/AVC
Duration : 1h 33mn
Width : 1 920 pixels
Height : 1 072 pixels
Display aspect ratio : 16:9
Original display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Writing library : x264 core 120
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=crf / mbtree=1 / crf=20.0 / qcomp=0.60 / qpmin=3 / qpmax=69 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Language : English
Default : Yes
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio #1
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC
Duration : 1h 33mn
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Frame rate : 46.875 fps (1024 spf)
Compression mode : Lossy
Language : German
Default : Yes
Forced : No
Audio #2
ID : 3
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : A_AC3
Duration : 1h 33mn
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Side: L R, LFE
Sampling rate : 48.0 KHz
Frame rate : 31.250 fps (1536 spf)
Compression mode : Lossy
Stream size : 257 MiB (8%)
Language : German
Default : No
Forced : No
Audio #3
ID : 4
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : A_AAC
Duration : 1h 33mn
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Frame rate : 46.875 fps (1024 spf)
Compression mode : Lossy
Language : English
Default : No
Forced : No
Display More
Auslesen will ich in diesem Beispiel dann nur die folgenden Zeilen davon (und davon immer nur den letzten String ausgeben);
Brauch also den Output -> AVC AAC AC-3 AAC
Ich probier da jetzt die ganze Zeit mit awk herum aber mir gelingt nix, wenn ich z.b:
mache kommt natürlich lauter Blödsinn raus da ja natürlich auch die Zeilen mit z.B: Format/Info usw. gefunden werden.
Hab jetzt weiter alle möglichen Varianten probiert aber komm auf keine Lösung, hat da jemand nen Tipp ?
Gruss
Bert