[FFmpeg-user] ffmpeg command required to convert MPEG TS to HLS with transcoding to aac

Mahesh Velankar mvelanka at gmail.com
Sat Dec 10 23:38:26 EET 2022


This is not for a single video, I have to keep the application ready
that will be receiving different input TS and the app will need to
prepare the playlists,  segments and master playlist.

I am  aware that I need to write script/app for this.

Please tell me the command line to prepare individual playlists and
segments............and I will be able to write the master playlist

Thanks in advance for your help



Robin wrote:


ffmpeg can do this, at least some parts. It will create the segments
and a master.m3u8 file for each track by itself. Still you will need
to create master.m3u8 File wich references all the tracks master.m3u8
yourself. My Script is about 3500 lines long, so be prepared that you
have to code lot yourself.

Im currently on the go, but I will try to provide you some more
advice. Are you about to encode a single Video or do you need a full
implemented rapackaging process for many vidz?

Kind regards,



On Sat, Dec 10, 2022 at 1:53 PM Mahesh Velankar <mvelanka at gmail.com> wrote:

> I have a transport stream file with following details (given by ffprobe)
> Input #0, mpegts, from 'f-13324-ccrtpa_before_tc_1669374838.ts':
>   Duration: 00:04:23.44, start: 8879.809433, bitrate: 2373 kb/s
>   Program 3
>     Stream #0:0[0x31]: Video: h264 (Main) ([27][0][0][0] / 0x001B),
> yuv420p(tv, bt709, progressive), 856x480 [SAR 320:321 DAR 16:9], Closed
> Captions, 30 fps, 29.97 tbr, 90k tbn, 60 tbc
>     Stream #0:1[0x34](eng): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
> 5.1(side), fltp, 320 kb/s
>     Stream #0:2[0x35](spa): Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz,
> stereo, fltp, 192 kb/s (visual impaired)
>     Stream #0:3[0x36]: Data: klv (KLVA / 0x41564C4B)
> I want to convert this into HLS playlists and segments. The requirements
> are as follows
> There will be two playlists
> playlist 1 will have a listing of TS segments. Each such segment will have
> 1. Video stream (Stream #0:0) from the above input (h264) and
> 2. Audio stream 1 (Stream #0:1) from the above input (ac3 5.1) .... but
> converted to aac format
> playlist 2 will have a listing of TS segments. Each such segment will have
> 1. Video stream (Stream #0:0) from the above input (h264) and
> 2. Audio stream 2 (Stream #0:2) from the above input (ac3 stereo) .... but
> converted to aac format
> In short the output segments will have one video and one audio stream.
> Since there are two audio streams I need to convert it into two different
> playlists ... each having video and one of the audio streams
> ac3 to aac conversion is mandatory,  as it has to be played in the browser.
> How can I achieve this with the ffmpeg command line? Please help or point
> me to any such recipe if already available.
> Thanks

More information about the ffmpeg-user mailing list