Convert H.264 to HLS in a Rails app - ruby-on-rails

Using carrierwave or another file upload plugin, there should be an easy way to convert uploaded mp4 (H.264) video files to Apple HLS. You need this for streaming videos on mobile devices.
This way, while uploading 1 streaming video file you can support most of the browsers (every browser except Opera and FF for Linux/OSX).
It can be done with ffmpeg, is anyone working on a gem?

How about streamio-ffmpeg? It seems to support custom command line parameters. You could add then use parameters like from this answer: https://stackoverflow.com/a/10047372/759140

You might also give carrierwave-video a try. It's backed by streamio-ffmpeg and allows passing custom settings through.

Related

libffmpeg: writing an RTSP stream to an output file

I'm working with libffmpeg in an iOS app. My goal is to connect to an RTSP source and write the media out to a file that can later be used with the iOS media player. Ideally I'd like to do this without transcoding the incoming data. I also want to be able to later re-encode the media with AVAssetExportSession if the user chooses to do so.
Because I want to create a file that is compatible with iOS, I'm limited (I believe) to mpeg, mp4 or quicktime (mov) formats.
Whenever I try to use one of these formats, I see the following warnings during my call to avformat_write_header:
[mov # 0x16401c00] Codec for stream 0 does not use global headers but container format requires global headers
[mov # 0x16401c00] Codec for stream 1 does not use global headers but container format requires global headers
My understanding is that the header wants to know the ultimate file size, which I do not know (the RTSP server is live streaming a camera, and the user stops the recording whenever they want). I guess that makes sense, but I know that others have successfully done this using the ffmpeg command line, so I'm confused as to what else I need to do here.
If I ignore the warning, I can still proceed with writing the file. If I choose mpeg or mp4 formats, my app crashes when I call av_write_trailer. If I use mov, I can successfully close the file, and the file does play back, but usually fails when I try to hand it to the AVAssetExportSession.
I would appreciate any insight into this. Thanks.
Frank
I found what appears to be a solution -- at least, it eliminates the warning. I had to set the CODEC_FLAG_GLOBAL_HEADER on both the audio and video codecs, before calling avcodec_open2.

What is the proper way to RTSP stream, transcode and save to file?

While showing the rstp-stream, we are trying to transcode, and record it to file for later use.
VLC 2.1.1 seems to work when using
vlc rtsp-stream :sout=#transcode{vcodec=mp1v,vb=700,scale=1}:duplicate{dst=display,dst=std{access=file,mux=asf,dst="C:\file.mpg"}}"
This seems to be broken on VLC 2.2.4
Documentation on VLC's wiki seems outdated.
Discrepancies with the vcodec/mux pairing as well as using samplerate instead of vb seem to fix it.
vlc rtsp-stream :sout=#transcode{vcodec=mp4v,scale=0.5,samplerate=44100}:duplicate{dst=display,dst=std{access=file,mux=mp4,dst='C:\file.mpg'}}"

PPTx with embedded video play on iOS

I am making an application which should be able to play any videos embedded in a PPTx. Currently using Quicklook Framework for iOS I am able to see the text or any images but not able to play the video. I thought of one solution as, Converting the PPTx to zip and then parse the XML files to give the video and then play, which doesn't look very practical as it needs to be done for every file where the structure keeps changing with very slide/PPT Slideshark is able to play videos embedded in a PPT. Any Ideas on how to achieve this ?
Converting PPTs into HTML5 is one of the solution.

Extract metadata without uploading

I hava a Ruby on Rails application that works with video playlists. Now I would like to extract timecode information from the video file without uploading it to the server (takes to long). Is the possible?
If it is not possible, is there a way to export te metadata locally and uploads these xmls (for example) to the server?
Thanks in advance
afaik, this is not possible in browsers that do not support File API. Take a look at jquery file upload and the way it allows user to identify the file extension before upload.

Buffering in Blackberry

Currently I am working on the application for which I have to use audio buffering. Please tell me how I can achieve this task as I am trying myself.
read this Buffer and play streamed media
Also, there's a great example in the Blackberry SDK, which shows buffered playback of a MP3 file.
Take a look in the 'samples' folder of JDE/Eclipse Plugin.

Resources