[FFmpeg-user] ffserver config for HLS

ajay parashar ajay_382000 at yahoo.co.in
Tue Oct 7 11:47:38 CEST 2014



On Tue, Oct 07, 2014 at 14:10:49 +0800, ajay parashar wrote:

> >   Stream #0:0 -> #1:0 (ac3 (native) -> ac3 (native))
> >   Stream #0:2 -> #1:1 (h264 (native) -> h264 (libx264))
> > Error while opening encoder for output stream #1:0 - maybe incorrect
> > parameters such as bit_rate, rate, width or height

> I played this video in VLC and confirm Video width, height , video
> frame rate and use the same value in above mentioned ffserver config
> file.

From: Moritz Barsnick <barsnick at gmx.net>

But as you can see from the message, something is wrong with the AC3
audio track (output stream #1:0). Have you tried stream-copying input
#0:0 or #0:1 instead of re-encoding it?

By the way, you have two outputs:
out%03d.ts (segment)

and
http://10.125.133.31:8080/feed1.ffm

and you are not specifying any parameters for the second one. Are you
sure this is what you are trying to achieve?

Moritz

****************************************************************************************
Okay for second output Now i am using tee option and below is the ffmpeg commnad, ffmpeg does not complain this time for incorrect
parameters  but ffserver is not streming data.

ffmpeg -i pentagon_hd_sd.ts -map 0:v:1 -map 0:a:0 -vcodec libx264 -acodec copy -f ssegment -segment_list_flags +live -segment_time 10 -segment_list playlist.m3u8 out%03d.ts |[f=hls] http://10.125.133.31:8080/feed1.ffm
ffmpeg version 2.4.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep 29 2014 13:53:35 with gcc 4.8.3 (GCC) 20140624 (Red Hat 4.8.3-1)
  configuration: --enable-gpl --enable-libx264 --enable-shared --disable-static --disable-stripping
  libavutil      54.  7.100 / 54.  7.100
bash: [f=hls]: command not found...
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[mpegts @ 0x181ee40] PES packet size mismatch
    Last message repeated 2 times
Input #0, mpegts, from 'pentagon_hd_sd.ts':
  Duration: 00:01:03.13, start: 32875.204489, bitrate: 5282 kb/s
  Program 1 
    Stream #0:0[0x44]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:1[0x45]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 384 kb/s
    Stream #0:2[0x46]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, bt709), 1280x720 [SAR 1:1 DAR 16:9], 59.94 fps, 59.94 tbr, 90k tbn, 119.88 tbc
    Stream #0:3[0x47]: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p(tv, smpte170m), 704x480 [SAR 10:11 DAR 4:3], 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
[libx264 @ 0x187c200] using SAR=10/11
[libx264 @ 0x187c200] using cpu capabilities: MMX2 SSE2 SSE3 Cache64
[libx264 @ 0x187c200] profile High, level 3.0
[mpegts @ 0x190aaa0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
Output #0, stream_segment,ssegment, to 'out%03d.ts':
  Metadata:
    encoder         : Lavf56.4.101
    Stream #0:0: Video: h264 (libx264), yuv420p, 704x480 [SAR 10:11 DAR 4:3], q=-1--1, 29.97 fps, 29.97 tbn, 29.97 tbc
    Metadata:
      encoder         : Lavc56.1.100 libx264
    Stream #0:1: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, 192 kb/s
Stream mapping:
  Stream #0:3 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:0 -> #0:1 (copy)
Press [q] to stop, [?] for help
[stream_segment,ssegment @ 0x1826dc0] Non-monotonous DTS in output stream 0:1; previous: 74880, current: 73459; changing to 74881. This may result in incorrect timestamps in the output file.
[mpegts @ 0x181ee40] DTS 2958942089 < 2958943387 out of order
[mpegts @ 0x1916920] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
[mpegts @ 0x1916900] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
[mpegts @ 0x190bfc0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
[mpegts @ 0x191b800] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
[mpegts @ 0x1ec39c0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.
    Last message repeated 1 times
[mpegts @ 0x181ee40] PES packet size mismatch1:02.67 bitrate=N/A dup=38 drop=0    
frame= 1891 fps= 27 q=29.0 size=N/A time=00:01:03.05 bitrate=N/A dup=38 drop=0    
[2]+  Stopped                 ffmpeg -i pentagon_hd_sd.ts -map 0:v:1 -map 0:a:0 -vcodec libx264 -acodec copy -f ssegment -segment_list_flags +live -segment_time 10 -segment_list playlist.m3u8 out%03d.ts | [f=hls] http://10.125.133.31:8080/feed1.ffm
[root at localhost media_files]# 

**********************************************************************************************
ffserver logs as below
 ffserver -f hls_ffmpeg_streaming.conf 
ffserver version 2.4.1 Copyright (c) 2000-2014 the FFmpeg developers
  built on Sep 29 2014 13:53:35 with gcc 4.8.3 (GCC) 20140624 (Red Hat 4.8.3-1)
  configuration: --enable-gpl --enable-libx264 --enable-shared --disable-static --disable-stripping
  libavutil      54.  7.100 / 54.  7.100
  libavcodec     56.  1.100 / 56.  1.100
  libavformat    56.  4.101 / 56.  4.101
  libavdevice    56.  0.100 / 56.  0.100
  libavfilter     5.  1.100 /  5.  1.100
  libswscale      3.  0.100 /  3.  0.100
  libswresample   1.  1.100 /  1.  1.100
  libpostproc    53.  0.100 / 53.  0.100
[mpegts @ 0x26092a0] Using AVStream.codec.time_base as a timebase hint to the muxer is deprecated. Set AVStream.time_base instead.


More information about the ffmpeg-user mailing list