Opened 5 years ago

Closed 3 years ago

#2236 closed defect (fixed)

Default stream selection does not work with HLS output

Reported by: nealzebub Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: hls
Cc: Blocked By:
Blocking: Reproduced by developer: yes
Analyzed by developer: no

Description

OS: CentOS 6.3 64-bit
Build: ffmpeg version N-49571-gb5f544a
Type: Burek static build, 64-bit, 20130204
Obtained from: http://ffmpeg.gusari.org/static/64bit/

I am attempting to encode from file(mainly MP4) to HTTP Live Streaming(HLS) compatible streams.

According to the FFmpeg documentation, http://ffmpeg.org/ffmpeg.html#Stream-selection:

By default ffmpeg includes only one stream of each type (video, audio, subtitle) present in the input files and adds them to each output file. It picks the "best" of each based upon the following criteria; for video it is the stream with the highest resolution, for audio the stream with the most channels, for subtitle it’s the first subtitle stream. In the case where several streams of the same type rate equally, the lowest numbered stream is chosen.
I should not have to map audio and videos streams when outputting to HLS.

I obtained a source file, so I could enter this report, from:

http://www.wowzamedia.com/_h264/bigbuckbunny_1500.mp4

The problem I encountered is when attempting to encode to HLS, without mapping audio and video streams, a message appears:

Output file #0 does not contain any stream

If I set the output to mpegts or MP4, I receive no such message, and encode completes normally, which means that auto stream selection functioned as described in the documentation for those outputs.

Here is the exact command used:

./ffmpeg.20130204 -report -i ./source_media/bigbuckbunny_1500.mp4 -frames:v 480 -c:v libx264 -crf 25 -profile:v baseline -g 48 -sc_threshold 0 -flags +cgop -c:a aac -strict -2 -b:a 112k -f ssegment -segment_time 10 -segment_format mpegts "hls_%02d.ts"

Here is the report:

ffmpeg started on 2013-02-04 at 12:08:21
Report written to "ffmpeg-20130204-120821.log"
Command line:
./ffmpeg.20130204 -report -i ./source_media/bigbuckbunny_1500.mp4 -frames:v 480 -c:v libx264 -crf 25 -profile:v baseline -g 48 -sc_threshold 0 -flags +cgop -c:a aac -strict -2 -b:a 112k -f ssegment -segment_time 10 -segment_format mpegts "hls_%02d.ts"
ffmpeg version N-49571-gb5f544a Copyright (c) 2000-2013 the FFmpeg developers
  built on Feb  4 2013 05:23:01 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
  libavutil      52. 17.101 / 52. 17.101
  libavcodec     54. 91.100 / 54. 91.100
  libavformat    54. 61.104 / 54. 61.104
  libavdevice    54.  3.103 / 54.  3.103
  libavfilter     3. 35.101 /  3. 35.101
  libswscale      2.  2.100 /  2.  2.100
  libswresample   0. 17.102 /  0. 17.102
  libpostproc    52.  2.100 / 52.  2.100
Splitting the commandline.
Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
Reading option '-i' ... matched as input file with argument './source_media/bigbuckbunny_1500.mp4'.
Reading option '-frames:v' ... matched as option 'frames' (set the number of frames to record) with argument '480'.
Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'.
Reading option '-crf' ... matched as AVOption 'crf' with argument '25'.
Reading option '-profile:v' ... matched as option 'profile' (set profile) with argument 'baseline'.
Reading option '-g' ... matched as AVOption 'g' with argument '48'.
Reading option '-sc_threshold' ... matched as AVOption 'sc_threshold' with argument '0'.
Reading option '-flags' ... matched as AVOption 'flags' with argument '+cgop'.
Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'aac'.
Reading option '-strict' ... matched as AVOption 'strict' with argument '-2'.
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '112k'.
Reading option '-f' ... matched as option 'f' (force format) with argument 'ssegment'.
Reading option '-segment_time' ... matched as AVOption 'segment_time' with argument '10'.
Reading option '-segment_format' ... matched as AVOption 'segment_format' with argument 'mpegts'.
Reading option 'hls_%02d.ts' ... matched as output file.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option report (generate a report) with argument 1.
Successfully parsed a group of options.
Parsing a group of options: input file ./source_media/bigbuckbunny_1500.mp4.
Successfully parsed a group of options.
Opening an input file: ./source_media/bigbuckbunny_1500.mp4.
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ad0a20] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ad0a20] ISO: File Type Major Brand: isom
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ad0a20] File position before avformat_find_stream_info() is 114213748
[h264 @ 0x2ad7260] Increasing reorder buffer to 1
[h264 @ 0x2ad7260] no picture ooo
[h264 @ 0x2ad7260] no picture 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ad0a20] All info found
rfps: 23.416667 0.019644
rfps: 23.416667 0.019644
rfps: 23.500000 0.014433
rfps: 23.500000 0.014433
rfps: 23.583333 0.010023
rfps: 23.583333 0.010023
rfps: 23.666667 0.006415
rfps: 23.666667 0.006415
rfps: 23.750000 0.003608
rfps: 23.750000 0.003608
rfps: 23.833333 0.001604
rfps: 23.833333 0.001604
rfps: 23.916667 0.000401
rfps: 23.916667 0.000401
rfps: 24.000000 0.000000
rfps: 24.083333 0.000401
rfps: 24.083333 0.000401
rfps: 24.166667 0.001603
rfps: 24.166667 0.001603
rfps: 24.250000 0.003607
rfps: 24.250000 0.003607
rfps: 24.333333 0.006413
rfps: 24.333333 0.006413
rfps: 24.416667 0.010021
rfps: 24.416667 0.010021
rfps: 24.500000 0.014430
rfps: 24.500000 0.014430
rfps: 24.583333 0.019641
rfps: 24.583333 0.019641
rfps: 47.416667 0.019645
rfps: 47.416667 0.019645
rfps: 47.500000 0.014434
rfps: 47.500000 0.014434
rfps: 47.583333 0.010024
rfps: 47.583333 0.010024
rfps: 47.666667 0.006416
rfps: 47.666667 0.006416
rfps: 47.750000 0.003609
rfps: 47.750000 0.003609
rfps: 47.833333 0.001604
rfps: 47.833333 0.001604
rfps: 47.916667 0.000401
rfps: 47.916667 0.000401
rfps: 48.000000 0.000000
rfps: 48.083333 0.000401
rfps: 48.083333 0.000401
rfps: 48.166667 0.001603
rfps: 48.166667 0.001603
rfps: 48.250000 0.003607
rfps: 48.250000 0.003607
rfps: 48.333333 0.006412
rfps: 48.333333 0.006412
rfps: 48.416667 0.010020
rfps: 48.416667 0.010020
rfps: 48.500000 0.014429
rfps: 48.500000 0.014429
rfps: 48.583333 0.019640
rfps: 48.583333 0.019640
rfps: 23.976024 0.000033
rfps: 23.976024 0.000033
rfps: 47.952048 0.000133
rfps: 47.952048 0.000133
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2ad0a20] File position after avformat_find_stream_info() is 27957
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './source_media/bigbuckbunny_1500.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isomavc1mp42isom
  Duration: 00:09:56.46, start: 0.000000, bitrate: 1531 kb/s
    Stream #0:0(eng), 21, 1/100000: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 1080x608, 1393 kb/s, 24 fps, 24 tbr, 100k tbn, 200k tbc
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(eng), 40, 1/48000: Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 131 kb/s
    Metadata:
      handler_name    : SoundHandler
Successfully opened the file.
Parsing a group of options: output file hls_%02d.ts.
Applying option frames:v (set the number of frames to record) with argument 480.
Applying option c:v (codec name) with argument libx264.
Applying option profile:v (set profile) with argument baseline.
Applying option c:a (codec name) with argument aac.
Applying option b:a (video bitrate (please use -b:v)) with argument 112k.
Applying option f (force format) with argument ssegment.
Successfully parsed a group of options.
Opening an output file: hls_%02d.ts.
Successfully opened the file.
Output #0, stream_segment,ssegment, to 'hls_%02d.ts':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isomavc1mp42isom
Output file #0 does not contain any stream
Statistics: 595406 bytes read, 2 seeks

Attachments (2)

ffmpeg-report_hls-out.log (6.5 KB) - added by nealzebub 5 years ago.
Report of HLS output, relying on auto stream selection
ffmpeg-report_mpegts-out.log (60.9 KB) - added by nealzebub 5 years ago.
Report of mpegts output, relying on auto stream selection. For comparison.

Download all attachments as: .zip

Change History (5)

Changed 5 years ago by nealzebub

Report of HLS output, relying on auto stream selection

Changed 5 years ago by nealzebub

Report of mpegts output, relying on auto stream selection. For comparison.

comment:1 Changed 5 years ago by michael

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 4 years ago by nealzebub

  • Resolution fixed deleted
  • Status changed from closed to reopened

This issue remains.
I used a Burek 64-bit Linux static build for 2013.06.14.
Automatic stream selection of input streams does not work when the output is HLS.
It still says "Output file #0 does not contain any stream"

I think there was some confusion over what this bug report is about. It's about auto selecting(mapping) input, not output.

comment:3 Changed 3 years ago by michael

  • Reproduced by developer set
  • Resolution set to fixed
  • Status changed from reopened to closed

iam pretty sure it was fixed but maybe it broke again
Fixed in 956f4087c6eb717e31f3b92fe03fd56a3747eccf and 26ffa8eaee2d3279b305dd7b0a82eafe28d3c856

Note: See TracTickets for help on using tickets.