HLS video segmenting complications. How to create a transport stream with ffmpeg

Posted by Agzam on Super User See other posts from Super User or by Agzam
Published on 2012-06-19T17:09:49Z Indexed on 2012/06/20 3:18 UTC
Read the original article Hit count: 558

Filed under:
|
|
|

I have h264 videos, and currently we're using Apple's HTTP Video Streaming tools and mediafilesegmenter to segment these files. What I need to do is to switch to alternative segmenter based on this very popular open-sourced segmenter

The problem is that this segmenter does not just take any video, but takes only MPEG-TS videos. So I have to convert my h264 videos to TS first.

I can do that with ffmpeg. I'm using this:

ffmpeg -i encoded.mp4 -vcodec h264 -i encoded.mp4 -sameq -acodec aac -strict experimental -f mpegts output.ts  

But this creates fairly larger output. And the reason is that Apple's segmenter keeps the same codec - AVC and the same audio codec - AAC, whereas ffmpeg changes video format to MPEG Video.

The question is: can I somehow keep the same AVC video codec and still convert video to a transport stream?

So my goal is to keep the same video quality and same video codecs as Apple's medifilesegmenter does.

UPD: Okay... it seems that ffmpeg CAN split videos into segments:

ffmpeg -i encoded.mp4 -c copy -map 0 -vbsf h264_mp4toannexb -f segment -segment_time 10 -segment_list test.m3u8 -segment_format mpegts segment%d.ts

That's still has one problem: it doesn't create http live streaming index file. (-segment_list creates a file with list of segments, but it doesn't look like HLS index). So, you still have to create index file

© Super User or respective owner

Related posts about ffmpeg

  • how to install ffmpeg in cpanel

    as seen on Super User - Search for 'Super User'
    i'm using dedicated server(linux) so i need to install ffmpeg in cpanel so here ffmpeg i found in Main Software Install a Perl Module but i writing script in php so how can i install ffmpeg phpperl when i'am trying to install ffmpeg in perl module i get this response Checking C compiler… >>> More

  • FFMpeg-PHP Installation Error

    as seen on Server Fault - Search for 'Server Fault'
    While installing FFmpeg-PHP, I got this interesting error: /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c: In function 'zim_ffmpeg_movie_getAudioStreamId': /usr/downloads/ffmpeg-php-0.6.0/ffmpeg_movie.c:1051: error: 'CODEC_TYPE_AUDIO' undeclared (first use in this function) /usr/downloads/ffmpeg-php-0… >>> More

  • git problems installing stuff [closed]

    as seen on Super User - Search for 'Super User'
    root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~# cd root@Frenzen:~# git clone --depth 1 git://source.ffmpeg.org/ffmpeg Initialized empty Git repository in /root/ffmpeg/.git/ root@Frenzen:~#… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

  • Unable to install ffmpeg-php

    as seen on Server Fault - Search for 'Server Fault'
    Hi, I followed the instructions on http://www.mysql-apache-php.com/ffmpeg-install.htm but ffmpeg-php does not show up in my phpinfo() The commands I ran (in order) #yum install ffmpeg ffmpeg-devel ... Public key for faac-1.26-1.el5.rf.x86_64.rpm is not installed #rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0… >>> More

Related posts about video-conversion