Re: [Libav-user] Decoding RTP streams with in-band SDP
On 9/16/16, 12:52 PM, "Libav-user on behalf of Carl Eugen Hoyos"wrote: 2016-09-16 15:06 GMT+02:00 Eric Reichert : > It could be that I don’t understand the question or the specs well enough. No, sorry: My knowledge of rtp is limited, I just suspected that H.264 over rtp needs the sdp file (to get SPS and PPS / extradata). If your stream is already in Annex B, I would have expected FFmpeg's parser and decoder to be able to handle it (no matter where your input data starts). Sorry I can't help more, Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user I understand. Thanks ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding RTP streams with in-band SDP
On 9/16/16, 4:22 PM, "Libav-user on behalf of Andy Shaules"wrote: On 9/16/2016 6:06 AM, Eric Reichert wrote: > On 9/16/16, 8:30 AM, "Libav-user on behalf of Carl Eugen Hoyos" wrote: > > 2016-09-16 14:24 GMT+02:00 Eric Reichert : > > > The streams I’m working with are of the Annex B variety. > > I would have expected that the rtp specification for H.264 > requires the video stream not to be in this format, am I > wrong? > > Can you provide such a stream (or even better a patch > to FFmpeg that allows to create a stream so a possible > fix can be tested)? > > Carl Eugen > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > RFC 3984/6184 do not prescribe Annex B. The old version of our software has to convert the 3984/6184 formatted H.264 into the Annex B format in order for (the ancient version of) FFMPEG to decode the video. That is, the old version of our software parses the RTP, reassembles the NAL Units from the fragmentation units, and adds the start codes before submitting the NAL units to the decoder. > > Does that answer your question? It could be that I don’t understand the question or the specs well enough. > > As far as providing a stream, I can provide tons of network captures carrying streams of that type. How shall I get them to you? > > Regarding a patch, it would be months before I could get anything submitted. My C skills aren’t great and I don’t know the FFMPEG codebase that well. > > By the way, thanks for the help and your continued work. You’ve got a tough job answering all the questions. > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Why dont you just add a packet type 96 to the sdp file? forming the sprop-parameter-sets is not too difficult. you could also optionally use a third party lib for networking and do the demux yourself and just use av_codec for decoding. Andy ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user Andy: I don’t think you understand the problem. First, of course we can use SDP files. I was trying to point out that it may be possible to auto-detect the streams without an SDP file. Second, one of the main reasons we’re rewriting our application is that we don’t want to do the demuxing ourselves. We’ve already been down that road. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Querying v4l2 devices
On 17.09.2016 00:08, Lukasz Marek wrote: I guess input device private data is not initialized, try to add this code right after formatContext->iformat=inputFormat, just replace s with formatContext if (s->iformat->priv_data_size > 0) { s->priv_data = av_mallocz(s->iformat->priv_data_size); if (s->iformat->priv_class) { *(const AVClass**)s->priv_data= s->iformat->priv_class; av_opt_set_defaults(s->priv_data); } } else s->priv_data = NULL; Maybe ff_alloc_input_device_context function should be moved to libavdevice's public API Ignore this answer, it should work but manipulates private fields You should use avdevice_list_input_sources. If still not working then please attach some *.c file so i can test it locally. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Querying v4l2 devices
On 16.09.2016 23:39, Timur Guseynov wrote: Hi. I wrote the code for getting a list of input devices: avdevice_register_all(); AVFormatContext*formatContext=avformat_alloc_context(); AVInputFormat*inputFormat=NULL; while((inputFormat=av_input_video_device_next(inputFormat))) { formatContext->iformat=inputFormat; AVDeviceInfoList*deviceList=NULL; avdevice_list_devices(formatContext,); if(deviceList) { for(inti=0;inb_devices;++i) { AVDeviceInfo*device=deviceList->devices[i]; .. } } avdevice_free_list_devices(); } It fails with SIGSEGV on avdevice_list_devices when it comes to v4l2 input format. Why does it fail? How can I get list of video devices? Btw I'm using Ubuntu 16.04 I guess input device private data is not initialized, try to add this code right after formatContext->iformat=inputFormat, just replace s with formatContext if (s->iformat->priv_data_size > 0) { s->priv_data = av_mallocz(s->iformat->priv_data_size); if (s->iformat->priv_class) { *(const AVClass**)s->priv_data= s->iformat->priv_class; av_opt_set_defaults(s->priv_data); } } else s->priv_data = NULL; Maybe ff_alloc_input_device_context function should be moved to libavdevice's public API ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
[Libav-user] Querying v4l2 devices
Hi. I wrote the code for getting a list of input devices: avdevice_register_all(); AVFormatContext *formatContext = avformat_alloc_context(); AVInputFormat *inputFormat = NULL; while((inputFormat = av_input_video_device_next(inputFormat))) { formatContext->iformat = inputFormat; AVDeviceInfoList *deviceList = NULL; avdevice_list_devices(formatContext, ); if(deviceList) { for(int i = 0; i < deviceList->nb_devices; ++i) { AVDeviceInfo *device = deviceList->devices[i]; .. } } avdevice_free_list_devices(); } It fails with SIGSEGV on avdevice_list_devices when it comes to v4l2 input format. Why does it fail? How can I get list of video devices? Btw I'm using Ubuntu 16.04 ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding RTP streams with in-band SDP
On 9/16/2016 6:06 AM, Eric Reichert wrote: On 9/16/16, 8:30 AM, "Libav-user on behalf of Carl Eugen Hoyos"wrote: 2016-09-16 14:24 GMT+02:00 Eric Reichert : > The streams I’m working with are of the Annex B variety. I would have expected that the rtp specification for H.264 requires the video stream not to be in this format, am I wrong? Can you provide such a stream (or even better a patch to FFmpeg that allows to create a stream so a possible fix can be tested)? Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user RFC 3984/6184 do not prescribe Annex B. The old version of our software has to convert the 3984/6184 formatted H.264 into the Annex B format in order for (the ancient version of) FFMPEG to decode the video. That is, the old version of our software parses the RTP, reassembles the NAL Units from the fragmentation units, and adds the start codes before submitting the NAL units to the decoder. Does that answer your question? It could be that I don’t understand the question or the specs well enough. As far as providing a stream, I can provide tons of network captures carrying streams of that type. How shall I get them to you? Regarding a patch, it would be months before I could get anything submitted. My C skills aren’t great and I don’t know the FFMPEG codebase that well. By the way, thanks for the help and your continued work. You’ve got a tough job answering all the questions. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user Why dont you just add a packet type 96 to the sdp file? forming the sprop-parameter-sets is not too difficult. you could also optionally use a third party lib for networking and do the demux yourself and just use av_codec for decoding. Andy ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] avformat_find_stream_info times out on rtp stream
2016-09-16 21:28 GMT+02:00 Philippe Gorley: Is it also reproducible with "./ffmpeg -i rtp://hostname:port"? Is it also reproducible if you build with "./configure && make"? >>> >>> It does not time out. >> >>Is this the answer to both questions or one of them? > > The second, as my configure line does not build ffmpeg, ffprobe et al. > >>> Any ideas why that is? >> >>Apparently your configure line disables a needed part >>but this may be a misunderstanding, see above. > > Any ideas on where to first look for the options I need? Possibly if you provide "ffmpeg -i" output after building without disabling anything. Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] avformat_find_stream_info times out on rtp stream
>2016-09-16 20:08 GMT+02:00 Philippe Gorley: >>> > I've compiled FFmpeg with the following configuration: >>> > ./configure --prefix=/usr/local --disable-everything >>> > --disable-programs --enable-protocols >>> > --enable-demuxers --enable-parser=h264 >>> > --enable-decoder=h264 --enable-indev=v4l2 >>> > --enable-shared >>> > >>> > Is this timeout a known bug? >>> >>> Is the issue reproducible with current FFmpeg git head? >>> I believe a similar issue was fixed recently. >> >> Yes, I have reproduced with git head (as of 30 or 45 minutes ago). >> >>> Is it also reproducible with "./ffmpeg -i rtp://hostname:port"? >>> Is it also reproducible if you build with "./configure && make"? >> >> It does not time out. > >Is this the answer to both questions or one of them? The second, as my configure line does not build ffmpeg, ffprobe et al. >> Any ideas why that is? > >Apparently your configure line disables a needed part >but this may be a misunderstanding, see above. Any ideas on where to first look for the options I need? >Carl Eugen Thanks for your help thus far, Philippe ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] avformat_find_stream_info times out on rtp stream
2016-09-16 20:08 GMT+02:00 Philippe Gorley: >> > I've compiled FFmpeg with the following configuration: >> > ./configure --prefix=/usr/local --disable-everything >> > --disable-programs --enable-protocols >> > --enable-demuxers --enable-parser=h264 >> > --enable-decoder=h264 --enable-indev=v4l2 >> > --enable-shared >> > >> > Is this timeout a known bug? >> >> Is the issue reproducible with current FFmpeg git head? >> I believe a similar issue was fixed recently. > > Yes, I have reproduced with git head (as of 30 or 45 minutes ago). > >> Is it also reproducible with "./ffmpeg -i rtp://hostname:port"? >> Is it also reproducible if you build with "./configure && make"? > > It does not time out. Is this the answer to both questions or one of them? > Any ideas why that is? Apparently your configure line disables a needed part but this may be a misunderstanding, see above. Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] avformat_find_stream_info times out on rtp stream
> 2016-09-16 18:16 GMT+02:00 Philippe Gorley >: > > I'm looking to upgrade my application (I'm currently using FFmpeg from the > > Ubuntu 16.04 repo) > > to a more recent release of FFmpeg, such as 3.1.3. Everything went well, > > except that > > avformat_find_stream_info now times out on my RTP stream, although it does > > eventually > > return the info. I've tried linking against master with the same result. > > Doing some > > investigation, I found that release 2.8.6 does not exhibit this behaviour, > > while 2.8.7 does. > > (Which change introduced the issue but see below first?) > > [...] > > > I've compiled FFmpeg with the following configuration: > > ./configure --prefix=/usr/local --disable-everything --disable-programs > > --enable-protocols > > --enable-demuxers --enable-parser=h264 --enable-decoder=h264 > > --enable-indev=v4l2 > > --enable-shared > > > > Is this timeout a known bug? > > Is the issue reproducible with current FFmpeg git head? > I believe a similar issue was fixed recently. Yes, I have reproduced with git head (as of 30 or 45 minutes ago). > Is it also reproducible with "./ffmpeg -i rtp://hostname:port"? > Is it also reproducible if you build with "./configure && make"? It does not time out. Any ideas why that is? Is it maybe an option in the AVDictionary? As for which change introduced it, I don't know; I downloaded and compiled the release tarballs from http://ffmpeg.org/releases/ > Carl Eugen > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Philippe ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding RTP streams with in-band SDP
2016-09-16 15:06 GMT+02:00 Eric Reichert: > It could be that I don’t understand the question or the specs well enough. No, sorry: My knowledge of rtp is limited, I just suspected that H.264 over rtp needs the sdp file (to get SPS and PPS / extradata). If your stream is already in Annex B, I would have expected FFmpeg's parser and decoder to be able to handle it (no matter where your input data starts). Sorry I can't help more, Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] avformat_find_stream_info times out on rtp stream
2016-09-16 18:16 GMT+02:00 Philippe Gorley: > I'm looking to upgrade my application (I'm currently using FFmpeg from the > Ubuntu 16.04 repo) > to a more recent release of FFmpeg, such as 3.1.3. Everything went well, > except that > avformat_find_stream_info now times out on my RTP stream, although it does > eventually > return the info. I've tried linking against master with the same result. > Doing some > investigation, I found that release 2.8.6 does not exhibit this behaviour, > while 2.8.7 does. (Which change introduced the issue but see below first?) [...] > I've compiled FFmpeg with the following configuration: > ./configure --prefix=/usr/local --disable-everything --disable-programs > --enable-protocols > --enable-demuxers --enable-parser=h264 --enable-decoder=h264 > --enable-indev=v4l2 > --enable-shared > > Is this timeout a known bug? Is the issue reproducible with current FFmpeg git head? I believe a similar issue was fixed recently. Is it also reproducible with "./ffmpeg -i rtp://hostname:port"? Is it also reproducible if you build with "./configure && make"? Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
[Libav-user] avformat_find_stream_info times out on rtp stream
Hi, I'm looking to upgrade my application (I'm currently using FFmpeg from the Ubuntu 16.04 repo) to a more recent release of FFmpeg, such as 3.1.3. Everything went well, except that avformat_find_stream_info now times out on my RTP stream, although it does eventually return the info. I've tried linking against master with the same result. Doing some investigation, I found that release 2.8.6 does not exhibit this behaviour, while 2.8.7 does. I can reproduce the behaviour with the following snippet, with vlc taking care of the RTP stream (I use a mp4 file with h264 and aac codecs): #include #include #include #include #include int main(int argc, char **argv) { AVFormatContext *fmt_ctx = NULL; char *file_to_stream = NULL; char *stream_addr = NULL; int ret; if (argc != 2) { fprintf(stderr, "usage: %s rtp://hostname:port\n", argv[0]); return 1; } stream_addr = argv[1]; av_register_all(); avformat_network_init(); fmt_ctx = avformat_alloc_context(); if (!fmt_ctx) { ret = AVERROR(ENOMEM); goto end; } ret = avformat_open_input(_ctx, stream_addr, NULL, NULL); if (ret < 0) { fprintf(stderr, "Could not open input\n"); goto end; } fmt_ctx->max_analyze_duration = 30 * AV_TIME_BASE; printf("Finding stream info\n"); struct timeval start, end; double elapsed_time; gettimeofday(, NULL); ret = avformat_find_stream_info(fmt_ctx, NULL); if (ret < 0) { fprintf(stderr, "Could not find stream information\n"); goto end; } gettimeofday(, NULL); elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0; elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0; av_dump_format(fmt_ctx, 0, stream_addr, 0); printf("Found stream info in %f ms\n", elapsed_time); end: avformat_close_input(_ctx); avformat_network_deinit(); if (ret < 0) { fprintf(stderr, "Error occurred: %s\n", av_err2str(ret)); return 1; } return 0; } I've compiled FFmpeg with the following configuration: ./configure --prefix=/usr/local --disable-everything --disable-programs --enable-protocols --enable-demuxers --enable-parser=h264 --enable-decoder=h264 --enable-indev=v4l2 --enable-shared Is this timeout a known bug? Any help is appreciated, Philippe ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] FFmpeg restream MP4 video automatically
Thank you, -stream_loop works as suggested!... On Fri, Sep 16, 2016 at 3:15 PM, Paul B Maholwrote: > On 9/16/16, Igor Gulyaev wrote: > > Unfortunately ffmpeg doesn't have loop option for video files, but > desired > > behavior can be accomplished using filters. > > There is -stream_loop. > > > > > Please check this ling > > http://video.stackexchange.com/questions/12905/repeat- > loop-input-video-with-ffmpeg > > > > Mentioned above too. > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding RTP streams with in-band SDP
On 9/16/16, 8:30 AM, "Libav-user on behalf of Carl Eugen Hoyos"wrote: 2016-09-16 14:24 GMT+02:00 Eric Reichert : > The streams I’m working with are of the Annex B variety. I would have expected that the rtp specification for H.264 requires the video stream not to be in this format, am I wrong? Can you provide such a stream (or even better a patch to FFmpeg that allows to create a stream so a possible fix can be tested)? Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user RFC 3984/6184 do not prescribe Annex B. The old version of our software has to convert the 3984/6184 formatted H.264 into the Annex B format in order for (the ancient version of) FFMPEG to decode the video. That is, the old version of our software parses the RTP, reassembles the NAL Units from the fragmentation units, and adds the start codes before submitting the NAL units to the decoder. Does that answer your question? It could be that I don’t understand the question or the specs well enough. As far as providing a stream, I can provide tons of network captures carrying streams of that type. How shall I get them to you? Regarding a patch, it would be months before I could get anything submitted. My C skills aren’t great and I don’t know the FFMPEG codebase that well. By the way, thanks for the help and your continued work. You’ve got a tough job answering all the questions. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] statically linking x264 and x265 into ffmpeg
mmmh, from what you are saying I might sarcastically (the AE/UE meaning) ups, a typo on my side, I meant AE/BE ... American English/British English. The ldflags you provided helped on your system (and I don't mean the path) and for your use-case, I am not convinced they will help everybody (with similar needs). (--disable-shared is the default, so using it in your configure line makes no difference) Interesting. Thanks for the heads-up. Anyhow, the flags I posted produce static libraries only that contain PIC. And that was what I was after. If --enable-pic really made a difference, you should ask yourself again (carefully) if that's really what you want. (Note that enable-pic is the default on x86-64 and cannot be turned off afair, it hurts on x86-32 and cannot do what people want because FFmpeg binaries are not position independent on x86-32, no matter the pic option.) Wow, that is really good to know for my use case. Thanks - P ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] statically linking x264 and x265 into ffmpeg
2016-09-16 14:37 GMT+02:00 Peter Steinbach: > >> --disable-shared has no effect, --enable-pic generally either has no >> effect, or an undesirable effect. >> >> I am not completely convinced that your extra ld flags would fix the >> issue for everybody. > > mmmh, from what you are saying I might sarcastically (the AE/UE meaning) I have no idea what AE/UE means. > ask, what configure flags actually do have an effect? ;) The ldflags you provided helped on your system (and I don't mean the path) and for your use-case, I am not convinced they will help everybody (with similar needs). (--disable-shared is the default, so using it in your configure line makes no difference) > Anyhow, the flags I posted produce static libraries only that contain PIC. > And that was what I was after. If --enable-pic really made a difference, you should ask yourself again (carefully) if that's really what you want. (Note that enable-pic is the default on x86-64 and cannot be turned off afair, it hurts on x86-32 and cannot do what people want because FFmpeg binaries are not position independent on x86-32, no matter the pic option.) Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] statically linking x264 and x265 into ffmpeg
--disable-shared has no effect, --enable-pic generally either has no effect, or an undesirable effect. I am not completely convinced that your extra ld flags would fix the issue for everybody. mmmh, from what you are saying I might sarcastically (the AE/UE meaning) ask, what configure flags actually do have an effect? ;) Anyhow, the flags I posted produce static libraries only that contain PIC. And that was what I was after. Best, Peter ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] statically linking x264 and x265 into ffmpeg
2016-09-16 14:31 GMT+02:00 Peter Steinbach: > Just to confirm the following does the static linking that I aspired to: > ./configure --prefix=${HOME}/software/ffmpeg/3.0.2-x264-hevc-static > --disable-shared --enable-pic --enable-libx264 --enable-libx265 --enable-gpl > --extra-ldflags="${HOME}/software/x264/master-static/lib/libx264.a > ${HOME}/software/x265/master-static/lib/libx265.a" ... more flags ... --disable-shared has no effect, --enable-pic generally either has no effect, or an undesirable effect. I am not completely convinced that your extra ld flags would fix the issue for everybody. Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] statically linking x264 and x265 into ffmpeg
./configure --prefix=/tmp/ffmpeg --disable-programs --enable-pic --enable-static --enable-libx264 --enable-libx265 --enable-gpl --extra-ldflags="/home/steinbac/software/x264/master-static/lib/libx264.a /home/steinbac/software/x265/master-static/lib/libx265.a" As said, --enable-static has no effect, I suggest you remove it to avoid misunderstandings. [...] I checked libavcodec with nm, and I see stuff like this: $ nm libavcodec.a|grep ff_hevc_transform_add16_10_sse2 2810 T ff_hevc_transform_add16_10_sse2 U ff_hevc_transform_add16_10_sse2 These are symbols from FFmpeg's decoder (note the "ff_"), they are unrelated to x265. (You can test by recompiling without x265.) Just to confirm the following does the static linking that I aspired to: ./configure --prefix=${HOME}/software/ffmpeg/3.0.2-x264-hevc-static --disable-shared --enable-pic --enable-libx264 --enable-libx265 --enable-gpl --extra-ldflags="${HOME}/software/x264/master-static/lib/libx264.a ${HOME}/software/x265/master-static/lib/libx265.a" ... more flags ... Thanks Carl Eugen, Peter ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding RTP streams with in-band SDP
2016-09-16 14:24 GMT+02:00 Eric Reichert: > The streams I’m working with are of the Annex B variety. I would have expected that the rtp specification for H.264 requires the video stream not to be in this format, am I wrong? Can you provide such a stream (or even better a patch to FFmpeg that allows to create a stream so a possible fix can be tested)? Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding RTP streams with in-band SDP
On 9/16/16, 8:03 AM, "Libav-user on behalf of Carl Eugen Hoyos"wrote: 2016-09-16 2:12 GMT+02:00 Eric Reichert : > Is there an option that can be passed to avformat_open_input > (or another call) that will enable decoding of an RTP stream > carrying H.264 video with the SDP in-band without having to > pass an out-of-band SDP file? Isn't there information necessary for decoding H.264 in the sdp file? Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user Yes. The important pieces of data are the SPS and PPS. Reading your question, I realize my subject wasn’t accurate. Here’s the correction. The streams I’m working with include the SPS and PPS in-band which is normally transmitted via SDP. That’s the actual problem I’m having. Forgive me if the following is something you already know but I want to make sure I’m explaining my idea correctly and we’re on the same page. I’m hoping there’s an existing solution to my problem. The streams I’m working with are of the Annex B variety. Annex B provides for the SPS, PPS, and SEI to be sent in-band. They have their own NAL Unit codes. So it’s possible for those packets to be auto-detected pre-decoding. The older version of the software I’m building, a version that sadly isn’t using FFMPEG to parse the containers, is doing precisely that. It waits for the SPS and PPS before submitting anything to the FFMPEG decoder. Most of the streams I’m working with include the SPS and PPS packets just before the first packet of an IDR fragmentation unit so it’s usually less than a second of packets before the SPS and PPS are found. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding RTP streams with in-band SDP
2016-09-16 2:12 GMT+02:00 Eric Reichert: > Is there an option that can be passed to avformat_open_input > (or another call) that will enable decoding of an RTP stream > carrying H.264 video with the SDP in-band without having to > pass an out-of-band SDP file? Isn't there information necessary for decoding H.264 in the sdp file? Carl Eugen ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding/encoding api
Thanks! Will try it out. пт, 16 сент. 2016 г. в 13:56, Steve: > Timur Guseynov wrote > > So I can write something like this and it would be ok? > > > > AVCodecContext *codecContext; > > AVPacket *packet; > > AVFrame *frame; > > // allocating codec context, getting packet > > . > > // > > avcodec_send_packet(codecContext, packet); > > while(avcodec_receive_frame(codecContext, frame) == 0) > > { > > av_frame_unref(frame); > > } > > No, that's where the doc you were referring to comes in, av_frame_unref is > called for you. But you have to handle the packet, so: > > avcodec_send_packet(codecContext, packet); > while(avcodec_receive_frame(codecContext, frame) == 0) > { > .. > } > av_packet_unref(packet); > > > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Libav-user-Decoding-encoding-api-tp4662664p4662679.html > Sent from the libav-users mailing list archive at Nabble.com. > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding/encoding api
Timur Guseynov wrote > So I can write something like this and it would be ok? > > AVCodecContext *codecContext; > AVPacket *packet; > AVFrame *frame; > // allocating codec context, getting packet > . > // > avcodec_send_packet(codecContext, packet); > while(avcodec_receive_frame(codecContext, frame) == 0) > { > av_frame_unref(frame); > } No, that's where the doc you were referring to comes in, av_frame_unref is called for you. But you have to handle the packet, so: avcodec_send_packet(codecContext, packet); while(avcodec_receive_frame(codecContext, frame) == 0) { .. } av_packet_unref(packet); -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-Decoding-encoding-api-tp4662664p4662679.html Sent from the libav-users mailing list archive at Nabble.com. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] Decoding/encoding api
So I can write something like this and it would be ok? AVCodecContext *codecContext; AVPacket *packet; AVFrame *frame; // allocating codec context, getting packet . // avcodec_send_packet(codecContext, packet); while(avcodec_receive_frame(codecContext, frame) == 0) { av_frame_unref(frame); } пт, 16 сент. 2016 г. в 2:26, Steve: > Timur Guseynov wrote > > I'm a bit confused with decoding/encoding api. I've read this > > https://ffmpeg.org/doxygen/3.1/group__lavc__encdec.html; > > documentation and > > it says "Receive output in a loop. Periodically call one of the > > avcodec_receive_*()...". > > > > avcodec_receive_frame() docs say "the function will always call > > av_frame_unref(frame) before doing anything else." The same goes for > > avcodec_receive_packet(). > > > > So, for example, I will write such code: > > > > AVCodecContext *codecContext; > > AVPacket *packet; > > AVFrame *frame; > > // allocating codec context, getting packet > > . > > // > > avcodec_send_packet(codecContext, packet); > > while(avcodec_receive_frame(codecContext, frame) == 0) > > { > > } > > > > Will this code be functioning right? > > > > ___ > > Libav-user mailing list > > > Libav-user@ > > > http://ffmpeg.org/mailman/listinfo/libav-user > > The doc for avcodec_receive_packet has you need to check a typo, it calls > av_packet_unref. This is just convenience, you would have to call > av_packet_unref or av_frame_unref yourself otherwise on each turn. > > Your code would be ok but you need to call av_packet_unref at the end > because you retain ownership of the packet. > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Libav-user-Decoding-encoding-api-tp4662664p4662672.html > Sent from the libav-users mailing list archive at Nabble.com. > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] FFmpeg restream MP4 video automatically
On 9/16/16, Igor Gulyaevwrote: > Unfortunately ffmpeg doesn't have loop option for video files, but desired > behavior can be accomplished using filters. There is -stream_loop. > > Please check this ling > http://video.stackexchange.com/questions/12905/repeat-loop-input-video-with-ffmpeg > Mentioned above too. ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
Re: [Libav-user] FFmpeg restream MP4 video automatically
Unfortunately ffmpeg doesn't have loop option for video files, but desired behavior can be accomplished using filters. Please check this ling http://video.stackexchange.com/questions/12905/repeat-loop-input-video-with-ffmpeg On Fri, Sep 16, 2016 at 10:55 AM, black copperwrote: > I am streaming RTSP with command line something like this: > > ffmpeg -re -i ~/Downloads/test.mp4 -c copy -f rtsp rtsp://127.0.0.1:1935/ > livetest/stream > > Original video length is about 15 minutes. > > I want to automatically restart once file is finished - sort of like in a > continuous loop. > > Does FFmpeg command line give me this option? Or do I need to implement > some other way? > > Thanks > > ___ > Libav-user mailing list > Libav-user@ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user
[Libav-user] FFmpeg restream MP4 video automatically
I am streaming RTSP with command line something like this: ffmpeg -re -i ~/Downloads/test.mp4 -c copy -f rtsp rtsp:// 127.0.0.1:1935/livetest/stream Original video length is about 15 minutes. I want to automatically restart once file is finished - sort of like in a continuous loop. Does FFmpeg command line give me this option? Or do I need to implement some other way? Thanks ___ Libav-user mailing list Libav-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user