1. H.265/HEVC 播放器
1) VLC media player 2.1.3 (眼下不支持H.265 TS播放)
2) ffmpeg中的ffplay (如:ffplay hevc.ts)
3) GPAC中的MP4Client (如:MP4Client hevc.ts, 或MP4Client hevc.mp4)
2. H.265/HEVC編碼器
全部編碼器都是基於x265來做的。其參考命令例如以下所看到的:
ffmpeg.exe -i "E:\video\yak.mp4" -pix_fmt yuv420p -f yuv4mpegpipe - 2> nul | x265.exe -p medium --crf 26 --fps 30 -f 2283 -o "E:\video\test\temp0.hvc" --y4m -
經常使用的工具例如以下所看到的:
2.1 CINEMARTIN CINEC v.2.7.5 Gold
CINEMARTIN CINEC v.2.7.5 Gold是一個商業軟件,做4K H.265壓縮時常常出現crash。且占用大量硬盤空間。對於H.265可產生hevc文件,可供MP4Box作為輸入以生成.mp4文件,從而使用mp42ts生成.ts文件。
2.2 Internet Friendly Media Encoder
Internet Friendly Media Encoder是一款ssf開源項目,其性能和功能非常好。僅僅是眼下可用,代碼還沒有開放。且在運行過程中,還會顯示其具體log信息,不占用硬盤空間,共關鍵的命令例如以下所看到的:
Internet Friendly Media Encoder工作步驟: 1)[ ok ] Loaded ffmpeg.exe [info] Command: -i "E:\video\kayak.mp4" -vn -ar 44100 -y "E:\video\test\temp1.wav" 2)[ ok ] Loaded libfaac.dll [info] Command: -b 96 -o "E:\video\test\temp1.aac" "E:\video\test\temp1.wav" 3)[info] Command: ffmpeg.exe -i "E:\video\kayak.mp4" -pix_fmt yuv420p -f yuv4mpegpipe - 2> nul | x265.exe -p medium --crf 26 --fps 30 -f 2283 -o "E:\video\test\temp0.hvc" --y4m - 4)[ ok ] Loaded libmp4.dll [info] Command: -add "E:\video\test\temp0.hvc#video:name=Encoded with IFME v3.2. 0.0:fmt=HEVC:fps=30" -add "E:\video\test\temp1.aac#audio:name=Track 1" "E:\video \test\kayak.mp4" Syntax: x265 [options] infile [-o] outfile infile can be YUV or Y4M outfile is raw HEVC bitstream ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
眼下僅僅能輸出H.265 .mp4和.mkv文件。
2.3 ffmpeg
ffmpeg是一款功能強大且基礎的軟件,其使用示比例如以下所看到的:
ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... ffmpeg -i ./kayak.mp4 -c copy -bsf h264_mp4toannexb -mpegts_original_network_id 0x1122 -mpegts_transport_stream_id 0x3344 -mpegts_service_id 0x5566 -mpegts_pmt_start_pid 0x1500 -mpegts_start_pid 0x150 -metadata service_provider="Some provider" -metadata service_name="Some Channel" -y out0.ts //h.264 ffmpeg -i ./kayak.mp4 -c copy -bsf h264_mp4toannexb -y out1.ts //h.264 ffmpeg -i ./test.mp4 -c copy -bsf h264_mp4toannexb -y out.ts //h.264 ffmpeg -i ./test.mp4 -vframes 200 -r 25 -s 3840x2160 -aspect 16:9 -b:v 12000000 -vcodec hevc -y out.ts // h.265/hevc ffmpeg -i ./test.mp4 -vframes 200 -r 25 -s 3840x2160 -aspect 16:9 -b:v 12000000 -vcodec hevc -mpegts_original_network_id 0x1122 -mpegts_transport_stream_id 0x3344 -mpegts_service_id 0x5566 -mpegts_pmt_start_pid 0x1500 -mpegts_start_pid 0x150 -metadata service_provider="Some provider" -metadata service_name="Some Channel" -y out.ts //h.265/hevc
使用ffmpeg能夠生成H.265 .TS和.MP4文件。
2.4 GPAC
GPAC能夠把x265生成的hevc流(.hevc)打包成.mp4和.ts文件,其用法例如以下:
2.4.1 MP4Box
How to embed HEVC into MP4 file format
./MP4Box -add name_of_annexB_bitstream.(bit,bin,265) -fps 50 -new output.mp4 ./MP4Box -v -add Catus_1920x1080_50_qp32.bin:FMT=HEVC -fps 50 -new output.mp4 ./MP4Client output.mp4 # to play HEVC mp4 content
2.4.2 mp42ts
How to embed HEVC into TS./mp42ts -prog=hevc.mp4 -dst-file=test.ts ./mp42ts -prog=output.mp4 -dst-file=hevc.ts ./MP4Client test.ts # to play HEVC transport streams
參考信息:
1. Handbrake Support H.265: http://handbrake.fr/nightly.php
2. H.265 官網:http://x265.org/
3. OpenHEVC:https://github.com/OpenHEVC