Wie zum codieren von H. 264-video mit FFmpeg-C-API und dann öffnen Sie die Ausgabe mit dem media player?

Ich versuche zu Kodieren von H. 264-video mit FFMPEG-C-API.
Ich habe erfolgreich kompiliert und ausgeführt, die decoding/encoding-Beispiel zur Verfügung gestellt von FFMPEG.

Das problem, das ich bin vor ist, dass die .mpg-Datei (kodiert mit AV_CODEC_ID_MPEG1VIDEO) das Beispiel erstellt funktioniert. Windows erstellt ein thumbnail und alles. Auf der anderen Seite die .h264 (codiert mit AV_CODEC_ID_H264) Datei nicht. Wenn ich versuche, spielen Sie die Datei in VLC die Wiedergabe - /pause-Taste flackert, keine Miniaturansicht im windows, kein gar nichts.

Während der Codierung libx264-Berichte die folgenden:

[libx264 @ 004b81a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 004b81a0] profile High, level 1.3
[libx264 @ 004b81a0] frame I:3     Avg QP:26.79  size:  2116
[libx264 @ 004b81a0] frame P:12    Avg QP:26.60  size:   789
[libx264 @ 004b81a0] frame B:10    Avg QP:31.39  size:   499
[libx264 @ 004b81a0] consecutive B-frames: 20.0% 80.0%
[libx264 @ 004b81a0] mb I  I16..4: 78.3% 11.6% 10.1%
[libx264 @ 004b81a0] mb P  I16..4: 77.4%  0.6%  0.1%  P16..4: 20.3%  0.7%  0.9%  0.0%  0.0%    skip: 0.0%
[libx264 @ 004b81a0] mb B  I16..4:  0.0%  0.0%  0.0%  B16..8:  9.4%  0.2%  0.0%  direct:11.0%  skip:79.4%  L0:25.4% L1:35.4% BI:39.2%
[libx264 @ 004b81a0] final ratefactor: 17.03
[libx264 @ 004b81a0] 8x8 transform intra:3.4% inter:31.3%
[libx264 @ 004b81a0] direct mvs  spatial:0.0% temporal:100.0%
[libx264 @ 004b81a0] coded y,uvDC,uvAC intra: 4.4% 35.8% 1.6% inter: 1.3% 34.5% 9.5%
[libx264 @ 004b81a0] i16 v,h,dc,p:  0%  0%  0% 100%
[libx264 @ 004b81a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7% 20% 17% 49%  0%  0%  0%  1%  6%
[libx264 @ 004b81a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14%  7% 18% 45%  2%  7%  2%  3%  2%
[libx264 @ 004b81a0] i8c dc,h,v,p:  2%  6%  4% 88%
[libx264 @ 004b81a0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 004b81a0] ref P L0: 95.6%  1.6%  2.2%  0.5%  0.2%
[libx264 @ 004b81a0] ref B L0: 67.5% 28.5%  3.2%  0.8%
[libx264 @ 004b81a0] kb/s:166.45

"ffprobe.exe test.h264 -show_streams" gibt

[STREAM]
index=0
codec_name=h264
codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
profile=High
codec_type=video
codec_time_base=1/50
codec_tag_string=[0][0][0][0]
codec_tag=0x0000
width=352
height=288
has_b_frames=1
sample_aspect_ratio=0:1
display_aspect_ratio=0:1
pix_fmt=yuv420p
level=13
timecode=N/A
id=N/A
r_frame_rate=50/2
avg_frame_rate=25/1
time_base=1/1200000
start_pts=N/A
start_time=N/A
duration_ts=N/A
duration=N/A
bit_rate=N/A
nb_frames=N/A
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=0
DISPOSITION:dub=0
DISPOSITION:original=0
DISPOSITION:comment=0
DISPOSITION:lyrics=0
DISPOSITION:karaoke=0
DISPOSITION:forced=0
DISPOSITION:hearing_impaired=0
DISPOSITION:visual_impaired=0
DISPOSITION:clean_effects=0
DISPOSITION:attached_pic=0
[/STREAM]

Dort können Sie sehen:

start_time=N/A
duration_ts=N/A
duration=N/A

Habe ich versucht, die unzähligen änderungen an den AVCodecContext und in der Vielzahl der Parameter, die Optionen zu av_opt_set Funktion. Noch kein Glück, immer eine Arbeit von H. 264 video. Ich habe sogar versucht, verschiedene Versionen von FFmpeg. Kein Glück.

Bin ich mit dem "FFmpeg git-0fb64da 32-bit-Dev" bauen aus Zeranoe und MinGw 4.7.2

InformationsquelleAutor GummiB | 2013-05-06
Schreibe einen Kommentar