[FFmpeg-user] Converting to h.265, keeping all audio streams

cvb at kruemel.org cvb at kruemel.org
Tue Jan 6 22:44:11 CET 2015


Hi, I'm testing converting my h.264 movies to h.265 using ffmpeg (2.5.2 
64-bit static):

ffmpeg -i "${TARGET}" -c:a copy -c:v libx265 -preset slow -x265-params 
crf=24 -strict experimental "${TARGET}.mp4"

I had hoped that this would transcode the video stream, keeping all 
audio streams. But only one audio stream is kept, the others are 
deleted:

ffprobe of the original:

[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=[27][0][0][0]
codec_tag=0x001b
width=1920
height=1080
has_b_frames=1
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=40
color_range=tv
color_space=bt709
color_transfer=bt709
color_primaries=bt709
chroma_location=left
timecode=N/A
is_avc=0
nal_length_size=0
id=0xff
r_frame_rate=50/1
avg_frame_rate=25/1
time_base=1/90000
start_pts=5683659190
start_time=63151.768778
duration_ts=705828453
duration=7842.538367
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=8
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]
[STREAM]
index=1
codec_name=ac3
codec_long_name=ATSC A/52A (AC-3)
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[6][0][0][0]
codec_tag=0x0006
sample_fmt=fltp
sample_rate=48000
channels=6
channel_layout=5.1(side)
bits_per_sample=0
dmix_mode=-1
ltrt_cmixlev=-1.000000
ltrt_surmixlev=-1.000000
loro_cmixlev=-1.000000
loro_surmixlev=-1.000000
id=0x103
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/90000
start_pts=5683657955
start_time=63151.755056
duration_ts=705818880
duration=7842.432000
bit_rate=384000
max_bit_rate=N/A
bits_per_raw_sample=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
TAG:language=deu
[/STREAM]
[STREAM]
index=2
codec_name=ac3
codec_long_name=ATSC A/52A (AC-3)
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=[6][0][0][0]
codec_tag=0x0006
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
dmix_mode=-1
ltrt_cmixlev=-1.000000
ltrt_surmixlev=-1.000000
loro_cmixlev=-1.000000
loro_surmixlev=-1.000000
id=0x104
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/90000
start_pts=5683656908
start_time=63151.743422
duration_ts=705827655
duration=7842.529500
bit_rate=192000
max_bit_rate=N/A
bits_per_raw_sample=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
TAG:language=eng
[/STREAM]
[STREAM]
index=3
codec_name=unknown
codec_long_name=unknown
profile=unknown
codec_type=unknown
codec_time_base=0/1
codec_tag_string=[6][0][0][0]
codec_tag=0x0006
id=0x20
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/90000
start_pts=5683656908
start_time=63151.743422
duration_ts=705830735
duration=7842.563722
bit_rate=N/A
max_bit_rate=N/A
bits_per_raw_sample=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]

The converted file only has one audio stream:

[STREAM]
index=0
codec_name=hevc
codec_long_name=HEVC (High Efficiency Video Coding)
profile=Main
codec_type=video
codec_time_base=1/25
codec_tag_string=hev1
codec_tag=0x31766568
width=1920
height=1080
has_b_frames=2
sample_aspect_ratio=1:1
display_aspect_ratio=16:9
pix_fmt=yuv420p
level=120
color_range=tv
color_space=unknown
color_transfer=unknown
color_primaries=unknown
chroma_location=unspecified
timecode=N/A
id=N/A
r_frame_rate=25/1
avg_frame_rate=25/1
time_base=1/12800
start_pts=0
start_time=0.000000
duration_ts=100384768
duration=7842.560000
bit_rate=848773
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=196064
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
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
TAG:language=und
TAG:handler_name=VideoHandler
[/STREAM]
[STREAM]
index=1
codec_name=ac3
codec_long_name=ATSC A/52A (AC-3)
profile=unknown
codec_type=audio
codec_time_base=1/48000
codec_tag_string=ac-3
codec_tag=0x332d6361
sample_fmt=fltp
sample_rate=48000
channels=2
channel_layout=stereo
bits_per_sample=0
dmix_mode=-1
ltrt_cmixlev=-1.000000
ltrt_surmixlev=-1.000000
loro_cmixlev=-1.000000
loro_surmixlev=-1.000000
id=N/A
r_frame_rate=0/0
avg_frame_rate=0/0
time_base=1/48000
start_pts=0
start_time=0.000000
duration_ts=376442880
duration=7842.560000
bit_rate=384000
max_bit_rate=N/A
bits_per_raw_sample=N/A
nb_frames=245080
nb_read_frames=N/A
nb_read_packets=N/A
DISPOSITION:default=1
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
TAG:language=deu
TAG:handler_name=SoundHandler
[/STREAM]

Any hint on what I may be missing?

Thanks, Chris


More information about the ffmpeg-user mailing list