>
> Hello all,
>
> I can create a Transport Stream (ts) with 188 byte packet size with
> libavformat. This works fine. But I can not create an m2ts (MPEG 2
> Transport
> Stream-File) for bluray or such media. I looked into the mpegts.h and
> mpegts.c - file (under /libavformat) and see, that the 192byte Paket Size
> exists as an macro. But it seems that libavformat only support
> m2ts-reading.
> So my question is now, exists an hint to create a m2ts-Stream?
>
> Or alternatively:
>
> I can not find any information of how building an m2ts-Stream. OK I know
> that m2ts is only a 188byte ts-packet plus 4 byte Timecode. BUT How is the
> TimeCode build??? And how is the TimeCode saved??? Do I have to append it
> at
> the end of an "normal" ts packet?
>
>
> I am trying to do more or less the same without success.
> In ffserver I am trying to send a mpegts file video over RTP transport
> MT2P,
> thats is only mpegts packets without demux them, in one raw stream.
> We have follow the way you have do it and adapt the cmd_setup and cmd_play
> to work with the STB client I have to use, that only understand MP2T.
> Sending data we are quite loose.
> Could you please help us??

Hello,

so far I know, FFmpeg doesn't support sending m2ts packets, but I'm not
sure. You have to look at the possible output formats to find this out.
But if you do the RTP way, which I described, you can add this 4 Byte by
your self after read the packet from the local video file, before send
then to RTP. But I don't know how the format of this 4 Byte is about.

>
> the point 4. Do you use it in http_prepare_data??
>

No, because I don't use the ffserver code in my project.

To use my code for sending a mpegts file 'as is' to a client, you have to
modify my code, because it handles with raw-pictures. It first encode a
picture to MPEG-2 (encode_video()) and then send it as a mpeg-ts rtp
stream.
For you, is enough to open the file an read the ts-paket from it and then
write it to the rtp output.

>         tspkt.size = len;
>         tspkt.data = destbuff;
>
>         //write to output , not sure if _interleaved_ is the right call
>         av_interleaved_write_frame(rtpcontext, &tspkt);
>         av_free(destbuff);


Steffen

_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to