[FFmpeg-trac] #8711(ffmpeg:new): Wrong 'Stream mapping' selection
FFmpeg
trac at avcodec.org
Thu Jun 4 09:05:53 EEST 2020
#8711: Wrong 'Stream mapping' selection
----------------------------------+----------------------------------
Reporter: giuliano | Type: defect
Status: new | Priority: normal
Component: ffmpeg | Version: 4.2
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------+----------------------------------
Summary of the bug:
I'm trying to save a multi variant live streaming (input) using as output
a HLS format.
The problem is that the result is a video-audio out of sync.
The input live streaming has a HLS format with several variants.
From the ffmpeg output log I can see:
...
Program 0
...
Stream #0:0: Data: timed_id3 (ID3 / 0x20334449)
...
Stream #0:1: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
704x396 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
...
Stream #0:2: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz,
stereo, fltp
Program 1
...
Stream #0:3: Data: timed_id3 (ID3 / 0x20334449)
...
Stream #0:4: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p,
512x288 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
...
Stream #0:5: Audio: aac (LC) ([15][0][0][0] / 0x000F), 44100 Hz,
stereo, fltp
...
Program 2
...
Stream #0:6, 1, 1/90000: Data: timed_id3 (ID3 / 0x20334449), 0/1
...
Stream #0:7, 21, 1/90000: Video: h264 (Main), 1 reference frame
([27][0][0][0] / 0x001B), yuv420p(left), 512x288 [SAR 1:1 DAR 16:9], 0/1,
25 fps, 25 tbr, 90k tbn, 50 tbc
...
Stream #0:8, 36, 1/90000: Audio: aac (LC) ([15][0][0][0] / 0x000F),
48000 Hz, stereo, fltp
...
In case I do not specify the 'map' ffmpeg parameter, ffmpeg is selecting
streams from different 'Programs', i.e. Stream #0:7 and Stream #0:2, and
we have the video-audio out of sync.
In case I specifies the 'map' ffmpeg parameter selecting streams belonging
to the same 'Program', i.e. Stream #0:4 and Stream #0:5, we do NOT have
anymore the video-audio out of sync.
The problem with this solution is that, in case the variants/streams of
the input live streaming changes, I have always to change my map
parameters.
The fix I'm asking to be evaluated, to avoid the video-audio out of sync,
is the following:
In case the 'map' parameter is not specified, ffmpeg should select streams
belonging to the same 'Program'.
Does it has sense for you?
How to reproduce:
{{{
% ffmpeg -v 9 -loglevel 99 -nostdin -re -i
http://mediapolis.rai.itelinker/relinkerServlet.htm?cont=746966 -t 30 -c:v
copy -c:a copy -f segment -segment_list /.../liveRecorder.list
-segment_time 10 -segment_atclocktime 1 -strftime 1
/.../liveRecorder_%Y-%m-%d_%H-%M-%S_%s.ts > outputLog.txt 2>&1
ffmpeg version 4.2.2
built on Ubuntu 18.04.4 LTS
}}}
Patches should be submitted to the ffmpeg-devel mailing list and not this
bug tracker.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8711>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list