2

Anyone knows a good way to use http live streaming tools on non-Mac platforms? Can you tell me at least if there's good alternatives? I need mediafilesegmenter and mediastreamvalidator.

Or maybe anyone has a source code or something like that...

UPD: I've tried different segmenters, most of them are based on Carson's open-sourced segmenter. Now the difference between Apple's mediafilesegmenter and this one, that it takes only a transport stream, not just any video. And I need to segment h264 videos. When I use ffmpeg to convert h26s to mpeg-ts I'm getting much bigger files in the end. Even if I try to preserve same audio codec (aac) it changes video codec form avc to mpeg-ts.

Damn I hate Apple. How can they propose that thing as a standard if they don't even provide workarounds for another platforms.

I still need to find a way to segment h264 videos, and keep in the segmented files avc and aac codecs.

iLemming
  • 34,477
  • 60
  • 195
  • 309
  • http://stackoverflow.com/questions/7818314/multi-bitrate-live-hls-with-ffmpeg-on-windows http://stackoverflow.com/questions/8706984/any-updated-http-segmenter-for-ipad-iphone-video-streaming-with-latest-ffmpeg http://stackoverflow.com/questions/9803726/failed-to-compile-http-live-video-stream-segmenter-and-distributor – vipw Jun 14 '12 at 07:34

1 Answers1

4

If you're not specifying the video codec, and specifying an mpeg2 transport stream container, FFmpeg will default to MPEG2 video coding. If you already have MPEG4-AVC(h.264) encoded video and AAC audio, then you instruct FFmpeg to not re-encode the video and audio with these options: -vcodec copy -acodec copy

Your final command should be something like this:

ffmpeg -i inputfile -vcodec copy -acodec copy -f mpegts outputfile.ts

Then you can use one of the segmenter tools for segmenting and building the playlist. It's worth mentioning that new versions of FFmpeg support segmenting, but you still would need a program to create the playlist file.

vipw
  • 7,593
  • 4
  • 25
  • 48
  • when I use -f it still changes the codec from avc to mpeg, and that greatly increases size of the video. I've tried to use new ffmpeg segmenter and I liked it, the only thing I'm not sure if it creates HLS compliant segments... will be checking this later today – iLemming Jun 20 '12 at 14:17
  • Can you show your ffmpeg command line? Sometimes the order of parameters can cause problems – vipw Jun 20 '12 at 14:41
  • ffmpeg -i encoded.mp4 -c copy -map 0 -vbsf h264_mp4toannexb -f segment -segment_time 10 -segment_format mpegts stream%d.ts ... This works, but I'm not sure if those segments are correct. http://stackoverflow.com/questions/11121980/mediastreamvalidator-how-can-i-validate-local-files – iLemming Jun 20 '12 at 14:43
  • Yeah, I'm sure that it segments at I-frames. Just out of curiosity, why do you need the -map 0 part? – vipw Jun 20 '12 at 15:27
  • 2
    I don't know it doesn't work without that... says: Output file #0 does not contain any stream – iLemming Jun 20 '12 at 15:35
  • it didn't pass medistreamvalidator something wrong here. it says: unable to read video timestamp in track 0: this may be due to not having a keyframe in this segment.. First two track it complains about, all others are I guess are ok – iLemming Jun 20 '12 at 15:42