Re: [FFmpeg-user] Can MJPEG be live streamed without transcoding?

2022-01-09 Thread Moritz Barsnick
On Sun, Jan 09, 2022 at 09:59:24 -0500, John Van Ostrand wrote:
> I wonder if you could use netcat to direct the stream from Stdout to a
> network socket then use netcat at the other end to put it into the Stdin of
> the remote ffmpeg.

You don't need netcat, ffmpeg has TCP, UDP, HTTP (and further)
streaming options built in.

The "nut" container is a good choice for streaming for ffmpeg to
ffmpeg, it can handle quite a lot of codecs.

Moritz
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Can MJPEG be live streamed without transcoding?

2022-01-09 Thread Phil Rhodes via ffmpeg-user
 I tried to do something a bit like this some years ago for audio only. Don't 
ask me for the details as it's been a while, but we tried several solutions and 
never really got it to work. This was under Windows.
The idea was to create a wireless free space link using off the shelf wifi gear.
P
On Sunday, 9 January 2022, 14:59:45 GMT, John Van Ostrand 
 wrote:  
 
 On Sun., Jan. 9, 2022, 8:45 a.m. Adam Nielsen via ffmpeg-user, <
ffmpeg-user@ffmpeg.org> wrote:

> > >  [mpegts @ 0x6725d0] Stream 0, codec mjpeg, is muxed as a private data
> > >  stream and may not be recognized upon reading.
> >
> > You cannot mux random data into mpegts, this is not a limitation of
> FFmpeg.
> >
> > A small change to the FFmpeg source code probably makes possible what
> > you want, but since the resulting stream does not conform to any
> > specification, the developers will not do it.
>
> It doesn't have to be MPEG-TS, the only thing receiving this stream
> will be another FFmpeg instance, so it doesn't worry me whether it
> conforms to any standards or not, all I need is something FFmpeg can
> send to itself over UDP.
>
> Since FFmpeg can read raw compressed video from a file in a number of
> different codecs, I assumed it could do the same via UDP, but perhaps
> not.
>

I wonder if you could use netcat to direct the stream from Stdout to a
network socket then use netcat at the other end to put it into the Stdin of
the remote ffmpeg.

>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
  
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Can MJPEG be live streamed without transcoding?

2022-01-09 Thread John Van Ostrand
On Sun., Jan. 9, 2022, 8:45 a.m. Adam Nielsen via ffmpeg-user, <
ffmpeg-user@ffmpeg.org> wrote:

> > >   [mpegts @ 0x6725d0] Stream 0, codec mjpeg, is muxed as a private data
> > >   stream and may not be recognized upon reading.
> >
> > You cannot mux random data into mpegts, this is not a limitation of
> FFmpeg.
> >
> > A small change to the FFmpeg source code probably makes possible what
> > you want, but since the resulting stream does not conform to any
> > specification, the developers will not do it.
>
> It doesn't have to be MPEG-TS, the only thing receiving this stream
> will be another FFmpeg instance, so it doesn't worry me whether it
> conforms to any standards or not, all I need is something FFmpeg can
> send to itself over UDP.
>
> Since FFmpeg can read raw compressed video from a file in a number of
> different codecs, I assumed it could do the same via UDP, but perhaps
> not.
>

I wonder if you could use netcat to direct the stream from Stdout to a
network socket then use netcat at the other end to put it into the Stdin of
the remote ffmpeg.

>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Can MJPEG be live streamed without transcoding?

2022-01-09 Thread Adam Nielsen via ffmpeg-user
> >   [mpegts @ 0x6725d0] Stream 0, codec mjpeg, is muxed as a private data
> >   stream and may not be recognized upon reading.  
> 
> You cannot mux random data into mpegts, this is not a limitation of FFmpeg.
> 
> A small change to the FFmpeg source code probably makes possible what
> you want, but since the resulting stream does not conform to any
> specification, the developers will not do it.

It doesn't have to be MPEG-TS, the only thing receiving this stream
will be another FFmpeg instance, so it doesn't worry me whether it
conforms to any standards or not, all I need is something FFmpeg can
send to itself over UDP.

Since FFmpeg can read raw compressed video from a file in a number of
different codecs, I assumed it could do the same via UDP, but perhaps
not.

Thanks,
Adam.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Can MJPEG be live streamed without transcoding?

2022-01-09 Thread Gyan Doshi




On 2022-01-09 03:36 pm, Carl Eugen Hoyos wrote:

Am Sa., 8. Jan. 2022 um 07:54 Uhr schrieb Adam Nielsen via ffmpeg-user
:


   [mpegts @ 0x6725d0] Stream 0, codec mjpeg, is muxed as a private data
   stream and may not be recognized upon reading.

You cannot mux random data into mpegts, this is not a limitation of FFmpeg.


Well, one can. The muxer already doesn't reject any codec as the warning 
shows.




A small change to the FFmpeg source code probably makes possible what
you want, but since the resulting stream does not conform to any
specification, the developers will not do it.



I added an option -recast_ media to ffmpeg in 79ebdbb9b9
With this, the user can manually assign a decoder and process the 
packets in such a stream.


e.g.

ffmpeg -recast_media -c:0 mjpeg -iudp://[ff01:1::1]:5004 -map 0:v ...



Regards,
Gyan
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


Re: [FFmpeg-user] Can MJPEG be live streamed without transcoding?

2022-01-09 Thread Carl Eugen Hoyos
Am Sa., 8. Jan. 2022 um 07:54 Uhr schrieb Adam Nielsen via ffmpeg-user
:

>   [mpegts @ 0x6725d0] Stream 0, codec mjpeg, is muxed as a private data
>   stream and may not be recognized upon reading.

You cannot mux random data into mpegts, this is not a limitation of FFmpeg.

A small change to the FFmpeg source code probably makes possible what
you want, but since the resulting stream does not conform to any
specification, the developers will not do it.

Carl Eugen
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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


[FFmpeg-user] Can MJPEG be live streamed without transcoding?

2022-01-07 Thread Adam Nielsen via ffmpeg-user
Hi all,

I'm trying to stream video from a USB camera plugged into a Raspberry
Pi[1], however I can't work out how to stream the camera's MJPEG data
over a network without transcoding it first[2].

If I use a command like this:

  $ ffmpeg -f v4l2 -input_format mjpeg -video_size 1280x720
-i /dev/video1 -c:v copy -f rtp_mpegts udp://[ff01:1::1]:5004

Then it streams the data, but with this warning:

  [mpegts @ 0x6725d0] Stream 0, codec mjpeg, is muxed as a private data
  stream and may not be recognized upon reading.

I am using ffmpeg to receive the data, however I can't work out how to
tell ffmpeg to read the private data stream and use it as MJPEG data:

  $ ffmpeg -c:v mjpeg -i udp://[ff01:1::1]:5004 -map 0:v ...
  Input #0, mpegts, from 'udp://[ff01:1::1]:5004':
Duration: N/A, start: 509.858389, bitrate: N/A
Program 1 
  Metadata:
service_name: Service01
service_provider: FFmpeg
Stream #0:0[0x100]: Data: bin_data ([6][0][0][0] / 0x0006)
  Output #0, rtp_mpegts, to 'udp://239.0.0.1:5004':
  Output file #0 does not contain any stream

If I try to use "-map 0:v" then it tells me "Stream map '0:v' matches
no streams."

I tried using "-f rtp" instead of "-f rtp_mpegts" and that also sends
the data but again, I can't work out how to tell ffmpeg to read it as
MJPEG on the receiving end.

How can I stream the MJPEG data via UDP from one ffmpeg instance to
another?  I don't want to use pipes for this, because I suspect those
will cause the same problem[2].

Many thanks,
Adam.

[1] I am also streaming from the built in camera, but I need a second
video stream which the USB camera is for.

[2] The reason for asking is that I have discovered that the USB camera
sometimes does not return frames, which causes ffmpeg to freeze,
waiting for a frame that never arrives.  Ultimately I am using the
Raspberry Pi's hardware H264 encoder to transcode the MJPEG stream into
H264, but when ffmpeg freezes, it causes all hardware encoding on the
Pi to stop, and sometimes even causes the Pi to completely lock up
requiring a power cycle to recover from.  So to avoid this I am
thinking that if I stream the MJPEG data across the network (on
localhost) then have a second ffmpeg doing the H264 V4L2 M2M encoding,
if the first MJPEG one drops out it hopefully won't cause the second
H264 one to freeze and break the Pi.
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

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