How to create PIPE from media's URL

Post Reply
S@gittarius
Posts: 98
Joined: Sat May 08, 2010 8:12 pm

How to create PIPE from media's URL

Post by S@gittarius »

Hi Eugene,
Suppose I have a media’s URL in the form http://domain.name/media_resource_path.
How can I create a PIPE from it in order to further process the stream? WmsCreateResourcePipe?
Regards
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: How to create PIPE from media's URL

Post by Eugene »

Hi,
S@gittarius wrote: Suppose I have a media’s URL in the form http://domain.name/media_resource_path.
How can I create a PIPE from it in order to further process the stream? WmsCreateResourcePipe?
Regards
Use can use WmsDownloadURLToPipe
S@gittarius
Posts: 98
Joined: Sat May 08, 2010 8:12 pm

Re: How to create PIPE from media's URL

Post by S@gittarius »

Eugene wrote:Hi,
S@gittarius wrote: Suppose I have a media’s URL in the form http://domain.name/media_resource_path.
How can I create a PIPE from it in order to further process the stream? WmsCreateResourcePipe?
Regards
Use can use WmsDownloadURLToPipe
Wow!
You are very fast.
Thank you!
S@gittarius
Posts: 98
Joined: Sat May 08, 2010 8:12 pm

Re: How to create PIPE from media's URL

Post by S@gittarius »

Hi,
I tried to create a very simple tsMuxer transcoding profile but it didn’t work out.

Code: Select all

var
  MetaFileLines: TStringList;
  sMetaFileName: string; 

begin
  MetaFileLines := TStringList.Create;
  try                                 
    InputFileName := WmsGetItemProperty(mpiMediaResourceSource);      
    MetaFileLines.Add('MUXOPT --no-pcr-on-video-pid --vbr --vbv-len=1500');
    MetaFileLines.Add('V_MPEG4/ISO/AVC, "' + InputFileName + '", level=4.1, insertSEI, contSPS, track=1');
    sMetaFileName := ChangeFileExt(OutputFileName, '.meta');
    MetaFileLines.SaveToFile(sMetaFileName);
    OutputFileName := ChangeFileExt(OutputFileName, '.m2ts');
    TranscodingResult := WmsTranscodingExecute('TSMUXER', '"' + sMetaFileName + '" "' + OutputFileName + '"', True);
  finally
    MetaFileLines.Free
  end
end.
The target media is MP4 encapsulated and has two streams:
1. H264 video stream
2. AAC audio stream
As you may have already guessed it’s all about the old pal Youtube.
As seen from the code I tried to only mux the video stream because it doesn’t need to be transcoded. When I get this working I’ll try to and the audio stream.
Where do I go wrong? And how to pipe the HTTP stream directly to the tsMuxer?
Regards!
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: How to create PIPE from media's URL

Post by Eugene »

Hi,
S@gittarius wrote: I tried to create a very simple tsMuxer transcoding profile but it didn’t work out.

Code: Select all

var
  MetaFileLines: TStringList;
  sMetaFileName: string; 

begin
  MetaFileLines := TStringList.Create;
  try                                 
    InputFileName := WmsGetItemProperty(mpiMediaResourceSource);      
    MetaFileLines.Add('MUXOPT --no-pcr-on-video-pid --vbr --vbv-len=1500');
    MetaFileLines.Add('V_MPEG4/ISO/AVC, "' + InputFileName + '", level=4.1, insertSEI, contSPS, track=1');
    sMetaFileName := ChangeFileExt(OutputFileName, '.meta');
    MetaFileLines.SaveToFile(sMetaFileName);
    OutputFileName := ChangeFileExt(OutputFileName, '.m2ts');
    TranscodingResult := WmsTranscodingExecute('TSMUXER', '"' + sMetaFileName + '" "' + OutputFileName + '"', True);
  finally
    MetaFileLines.Free
  end
end.
The target media is MP4 encapsulated and has two streams:
1. H264 video stream
2. AAC audio stream
As you may have already guessed it’s all about the old pal Youtube.
As seen from the code I tried to only mux the video stream because it doesn’t need to be transcoded. When I get this working I’ll try to and the audio stream.
Where do I go wrong? And how to pipe the HTTP stream directly to the tsMuxer?
I think tsMuxer does not support any container in pipe-mode, only elementary streams.
S@gittarius
Posts: 98
Joined: Sat May 08, 2010 8:12 pm

Re: How to create PIPE from media's URL

Post by S@gittarius »

Hi,
Maybe I am wrong but pipes are handled just like files and supported containers are as follows:
* Elementary stream;
* Transport stream TS and M2TS;
* Program stream EVO/VOB/MPG;
* Matroska MKV/MKA;
* MP4/MOV
Even so could you please help in creating this special profile for media sources which are:
  • podcasts;
  • enclosed in MP4 container;
  • video stream is H264 and doesn’t need to be transcoded;
  • audio stream is AAC and has to be converted into AC3 format;
  • output container is M2TS as usual;
These parameters are static and we don’t need to go around finding the information. Just handle the input stream and produce the relevant output.
If you cannot afford the time I’ll keep on trying to do the script but without WMS functions’ explanation it’s a very hard task indeed.

Regards.
Eugene
Posts: 2940
Joined: Tue Nov 17, 2009 8:05 pm

Re: How to create PIPE from media's URL

Post by Eugene »

Hi,
S@gittarius wrote: Maybe I am wrong but pipes are handled just like files and supported containers are as follows:
Pipes does not support seek operations, it's may be problem for tsMuxer
S@gittarius wrote: Even so could you please help in creating this special profile for media sources which are:
  • podcasts;
  • enclosed in MP4 container;
  • video stream is H264 and doesn’t need to be transcoded;
  • audio stream is AAC and has to be converted into AC3 format;
  • output container is M2TS as usual;
These parameters are static and we don’t need to go around finding the information. Just handle the input stream and produce the relevant output.
If you cannot afford the time I’ll keep on trying to do the script but without WMS functions’ explanation it’s a very hard task indeed.
Transcoding profile "Movies-TsMuxer"
Post Reply