[FFmpeg-user] segment options not work in combining audio and video the same time?
Arachnia
asdfg1945 at gmail.com
Wed Apr 2 10:02:43 CEST 2014
I want to convert a rtsp stream to ts and m3u8. My command is
ffmpeg -i 'rtsp://localhost:5544/rtsptest' -vcodec libx264 -crf 24 -b:v 128k
-s 352x288 -profile:v baseline -pix_fmt yuv420p -flags -global_header -map 0
-f segment -segment_time 10 -segment_list_size 2 -segment_list test.m3u8
-segment_list_type m3u8 -segment_format mpegts 240p%08d.ts
It works fine. And then I try to add a empty audio track, command is
ffmpeg -f s16le -i /dev/zero -f rtsp -i 'rtsp://localhost:5544/rtsptest'
-vcodec libx264 -crf 24 -b:v 128k -s 352x288 -profile:v baseline -pix_fmt
yuv420p -c:a libfaac -ar 22050 -async 1 -ac 2 -b:a 1k -flags -global_header
-map 0 -f segment -segment_time 10 -segment_list_size 2 -segment_list
test.m3u8 -segment_list_type m3u8 -segment_format mpegts 240p%08d.ts
The ts file I get only have audio stream!
if I encode stream to a flv file, or a mp4 file, the commands all OK!
ffmpeg -f s16le -i /dev/zero -f rtsp -i 'rtsp://localhost:5544/rtsptest'
-vcodec libx264 -crf 24 -b:v 128k -s 352x288 -profile:v baseline -pix_fmt
yuv420p -c:a libfaac -ar 22050 -async 1 -ac 2 -b:a 1k -f flv test.flv
And I found that if I change position of input devices in command like this
ffmpeg -f rtsp -i 'rtsp://localhost:5544/rtsptest' -f s16le -i /dev/zero
-vcodec libx264 -crf 24 -b:v 128k -s 352x288 -profile:v baseline -pix_fmt
yuv420p -c:a libfaac -ar 22050 -async 1 -ac 2 -b:a 1k -flags -global_header
-map 0 -f segment -segment_time 10 -segment_list_size 2 -segment_list
test.m3u8 -segment_list_type m3u8 -segment_format mpegts 240p%08d.ts
Then ts files only have video stream.
Something wrong with me?
--
View this message in context: http://ffmpeg-users.933282.n4.nabble.com/segment-options-not-work-in-combining-audio-and-video-the-same-time-tp4664610.html
Sent from the FFmpeg-users mailing list archive at Nabble.com.
More information about the ffmpeg-user
mailing list