Re: [FFmpeg-devel] How to implement pcap ffmpeg format?

2023-02-22 Thread sonntex
It might be interesting. I didn’t find how to pass rtp to ffmpeg stdin.
That is why I started thinking about pcap.

Could you please show an example?

On Wed, 22 Feb 2023 at 08:04, Gijs Peskens  wrote:

> Wouldn't the simplest solution just be a tiny tool that unwraps the pcap
> stuff and just passes the packet data out on stdout?
> That's assuming ffmpeg allows receiving RTP packets on stdin.
>
> On 21-02-2023 23:55, sonntex wrote:
> > New pcap ffmpeg format can have all options rtpdec requires.
> >
> > Anyway, I don't suggest you implement this feature. I just want to find a
> > good entry point to start coding personally.
> >
> > I need to create a development tool for rtp tracing, and pcap files seem
> a
> > good idea because I can grab rtp using tcpdump, or create pcap files
> > directly in my application, or whatever. It's better then wrap vp8/vp9 to
> > ivf or h264 to byte stream and pass it to ffmpeg via pipe because it
> > doesn't require coding of new solutions for every video and audio formats
> > transferring over rtp.
> >
> > On Tue, Feb 21, 2023 at 10:38 PM Kieran Kunhya  wrote:
> >
> >> On Tue, 21 Feb 2023, 22:33 sonntex,  wrote:
> >>
> >>> I want to implement something which helps me to play rtp stored in pcap
> >>> files.
> >>>
> >>> tcpdump -i lo udp port 5 -s0 -w - | ffplay  -i -
> >>>
> >>> The specification of pcap files is really simple and I could create a
> new
> >>> ffmpeg format, but don't know how to process rtp packets extracted from
> >>> pcap, because it seems that all functions for rtp parsing are private.
> >>>
> >>> Need a good example of inner ffmpeg formats processing.
> >>>
> >> How is ffmpeg meant to know the meaning of the contents of a pcap and
> the
> >> format inside?
> >>
> >> This is a very bad idea.
> >>
> >> What's next, ffmpeg implementing userspace TCP? Are we going to add
> support
> >> for parsing filesystems as well?
> >>
> >> Regards,
> >> Kieran Kunhya
> >>
> >> ___
> >> ffmpeg-devel mailing list
> >> ffmpeg-devel@ffmpeg.org
> >> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >>
> >> To unsubscribe, visit link above, or email
> >> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> >>
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] How to implement pcap ffmpeg format?

2023-02-22 Thread sonntex
So, if I have an rtp stream inside my application and want to save it
somehow to a playable media container, I have to wrap this stream to
something that could be transferred by pipe to ffmpeg, for instance to ivf
or to h264 byte stream. The first format requires deep codec parsing to
extract at least width and height, perhaps other properties. Seems easy but
non-unified. Another approach is to pass the stream to a local udp socket,
simultaneously execute and control the ffmpeg process. It could lead to
data loss and requires socket coding in such a simple application.

I understand why ffmpeg developers don't want to include pcap support to
ffmpeg but it could be implemented as an external code by somebody else for
whom it seems to be useful. I can't really find any blockers to do that
except that all the code inside rtpdec is encapsulated in its *.c file and
is not accessible from a hypothetical new pcap format. What I found is that
udp.c derives url protocol interface and does the same as pcap format
should do - extract rtp packets from a source and pass it further to
rtpdec. The problem is that pcap format is a format, not a protocol, which
reads data from ffmpeg file protocol. And the question was how to build the
chain of  ->  -> ?

On Wed, Feb 22, 2023 at 12:54 PM Rémi Denis-Courmont 
wrote:

> Hi,
>
> I agree with Kieran that this doesn't look like it belongs in FFmpeg or in
> any media framework. In fact, Wireshark has some support for extracting
> media from RTP, and that seems like the right place for it.
>
> With that said, you can't realistically pass RTP packets on the standard
> input. RTP is datagram-based. Packet boundaries are relevant; it can't go
> over a pipe. Unless you use a Unix datagram socket as standard input, but
> that would be very weird.
>
> Besides, there may be multiple streams on different ports, with different
> payload maps, and the receiver needs to know which port which packet came
> on.
>
> Note: Unfortunately, earlier attempts to standardise a container for
> RTP/RTCP packets have failed.
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] How to implement pcap ffmpeg format?

2023-02-22 Thread sonntex
Are you sure that vp8 and vp9 can be put to mpeg-ts?

On Wed, Feb 22, 2023 at 3:25 PM Zhao Zhili  wrote:

> > -Original Message-
> > From: ffmpeg-devel  On Behalf Of
> sonntex
> > Sent: 2023年2月22日 21:59
> > To: FFmpeg development discussions and patches 
> > Subject: Re: [FFmpeg-devel] How to implement pcap ffmpeg format?
> >
> > So, if I have an rtp stream inside my application and want to save it
> > somehow to a playable media container, I have to wrap this stream to
> > something that could be transferred by pipe to ffmpeg, for instance to
> ivf
> > or to h264 byte stream. The first format requires deep codec parsing to
>
> Why not remux RTP to something like TS at the first replace, instead of
> deal with pcap?
>
> > extract at least width and height, perhaps other properties. Seems easy
> but
> > non-unified. Another approach is to pass the stream to a local udp
> socket,
> > simultaneously execute and control the ffmpeg process. It could lead to
> > data loss and requires socket coding in such a simple application.
> >
> > I understand why ffmpeg developers don't want to include pcap support to
> > ffmpeg but it could be implemented as an external code by somebody else
> for
> > whom it seems to be useful. I can't really find any blockers to do that
> > except that all the code inside rtpdec is encapsulated in its *.c file
> and
> > is not accessible from a hypothetical new pcap format. What I found is
> that
> > udp.c derives url protocol interface and does the same as pcap format
> > should do - extract rtp packets from a source and pass it further to
> > rtpdec. The problem is that pcap format is a format, not a protocol,
> which
> > reads data from ffmpeg file protocol. And the question was how to build
> the
> > chain of  ->  -> ?
> >
> > On Wed, Feb 22, 2023 at 12:54 PM Rémi Denis-Courmont 
> > wrote:
> >
> > > Hi,
> > >
> > > I agree with Kieran that this doesn't look like it belongs in FFmpeg
> or in
> > > any media framework. In fact, Wireshark has some support for extracting
> > > media from RTP, and that seems like the right place for it.
> > >
> > > With that said, you can't realistically pass RTP packets on the
> standard
> > > input. RTP is datagram-based. Packet boundaries are relevant; it can't
> go
> > > over a pipe. Unless you use a Unix datagram socket as standard input,
> but
> > > that would be very weird.
> > >
> > > Besides, there may be multiple streams on different ports, with
> different
> > > payload maps, and the receiver needs to know which port which packet
> came
> > > on.
> > >
> > > Note: Unfortunately, earlier attempts to standardise a container for
> > > RTP/RTCP packets have failed.
> > > ___
> > > ffmpeg-devel mailing list
> > > ffmpeg-devel@ffmpeg.org
> > > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> > >
> > > To unsubscribe, visit link above, or email
> > > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
> > >
> > ___
> > ffmpeg-devel mailing list
> > ffmpeg-devel@ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] How to implement pcap ffmpeg format?

2023-02-22 Thread sonntex
> On Wed, Feb 22, 2023 at 6:00 PM Zhao Zhili  wrote:
>
> You missed the point. Use any (streaming) container which supports the
codec, e.g., webm.

I've already discussed solutions with ivf and h264 byte stream which are
the same as webm but even easier in implementation. They are not applicable.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] How to implement pcap ffmpeg format?

2023-02-21 Thread sonntex
I want to implement something which helps me to play rtp stored in pcap
files.

tcpdump -i lo udp port 5 -s0 -w - | ffplay  -i -

The specification of pcap files is really simple and I could create a new
ffmpeg format, but don't know how to process rtp packets extracted from
pcap, because it seems that all functions for rtp parsing are private.

Need a good example of inner ffmpeg formats processing.
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-devel] How to implement pcap ffmpeg format?

2023-02-21 Thread sonntex
New pcap ffmpeg format can have all options rtpdec requires.

Anyway, I don't suggest you implement this feature. I just want to find a
good entry point to start coding personally.

I need to create a development tool for rtp tracing, and pcap files seem a
good idea because I can grab rtp using tcpdump, or create pcap files
directly in my application, or whatever. It's better then wrap vp8/vp9 to
ivf or h264 to byte stream and pass it to ffmpeg via pipe because it
doesn't require coding of new solutions for every video and audio formats
transferring over rtp.

On Tue, Feb 21, 2023 at 10:38 PM Kieran Kunhya  wrote:

> On Tue, 21 Feb 2023, 22:33 sonntex,  wrote:
>
> > I want to implement something which helps me to play rtp stored in pcap
> > files.
> >
> > tcpdump -i lo udp port 5 -s0 -w - | ffplay  -i -
> >
> > The specification of pcap files is really simple and I could create a new
> > ffmpeg format, but don't know how to process rtp packets extracted from
> > pcap, because it seems that all functions for rtp parsing are private.
> >
> > Need a good example of inner ffmpeg formats processing.
> >
>
> How is ffmpeg meant to know the meaning of the contents of a pcap and the
> format inside?
>
> This is a very bad idea.
>
> What's next, ffmpeg implementing userspace TCP? Are we going to add support
> for parsing filesystems as well?
>
> Regards,
> Kieran Kunhya
>
> >
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".