Re: [FFmpeg-devel] ffserver jpg output
The patch that caligula sent works. I tested it on the git from yesterday and firefox is now able to read the jpg ffserver output properly with that applied. The only difference is that I added an enter on line 26 because it was two lines into one. Can it be committed now? diff -Nrup ffmpeg-2.6.1--orig/ffserver.c ffmpeg-2.6.1/ffserver.c --- ffmpeg-2.6.1--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.c ffmpeg-2.6.1/ffserver_config.c --- ffmpeg-2.6.1--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.h ffmpeg-2.6.1/ffserver_config.h --- ffmpeg-2.6.1--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-2.6.1--orig/libavformat/allformats.c ffmpeg-2.6.1/libavformat/allformats.c --- ffmpeg-2.6.1--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-2.6.1/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-2.6.1--orig/libavformat/rawenc.c ffmpeg-2.6.1/libavformat/rawenc.c --- ffmpeg-2.6.1--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-2.6.1/libavformat/rawenc.c2015-04-05 02:33:53.0 +0200 @@ -250,6 +250,17 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] ffserver jpg patch
I changed it to git and add the .write header to the last part. The first part compiled after I changed ffserver.c, so it is no longer corrupted. Muxer detection seems to work when I tried it for the middle part. It should be good to fix ffserver now? diff -Nrup ffmpeg-git--orig/ffserver.c ffmpeg-git/ffserver.c --- ffmpeg-git--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-git--orig/ffserver_config.c ffmpeg-git/ffserver_config.c --- ffmpeg-git--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-git--orig/ffserver_config.h ffmpeg-git/ffserver_config.h --- ffmpeg-git--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-git--orig/libavformat/allformats.c ffmpeg-git/libavformat/allformats.c --- ffmpeg-git--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-git/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-git--orig/libavformat/rawenc.c ffmpeg-git/libavformat/rawenc.c --- ffmpeg-git--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-git/libavformat/rawenc.c2015-04-05 02:33:53.0 +0200 @@ -250,6 +250,17 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] ffserver jpg patch
patch attached. On Mon, May 04, 2015 at 06:35:36PM -0600, ill wrote: I changed it to git and add the .write header to the last part. The first part compiled after I changed ffserver.c, so it is no longer corrupted. Muxer detection seems to work when I tried it for the middle part. It should be good to fix ffserver now? patch is still corrupted by linebreaks probably your MUA is breaking long lines, try to attach the patch or use git send-email [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel diff -Nrup ffmpeg-git--orig/ffserver.c ffmpeg-git/ffserver.c --- ffmpeg-git--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-git--orig/ffserver_config.c ffmpeg-git/ffserver_config.c --- ffmpeg-git--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-git--orig/ffserver_config.h ffmpeg-git/ffserver_config.h --- ffmpeg-git--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-git--orig/libavformat/allformats.c ffmpeg-git/libavformat/allformats.c --- ffmpeg-git--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-git/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-git--orig/libavformat/rawenc.c ffmpeg-git/libavformat/rawenc.c --- ffmpeg-git--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-git/libavformat/rawenc.c2015-04-05$ 02:33:53.0 +0200 @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] ffserver jpg patch
Can this patch be applied now? It doesn't have any line breaks anymore. On Mon, May 04, 2015 at 06:35:36PM -0600, ill wrote: I changed it to git and add the .write header to the last part. The first part compiled after I changed ffserver.c, so it is no longer corrupted. Muxer detection seems to work when I tried it for the middle part. It should be good to fix ffserver now? patch is still corrupted by linebreaks probably your MUA is breaking long lines, try to attach the patch or use git send-email [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel diff -Nrup ffmpeg-git--orig/ffserver.c ffmpeg-git/ffserver.c --- ffmpeg-git--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-git--orig/ffserver_config.c ffmpeg-git/ffserver_config.c --- ffmpeg-git--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-git--orig/ffserver_config.h ffmpeg-git/ffserver_config.h --- ffmpeg-git--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-git--orig/libavformat/allformats.c ffmpeg-git/libavformat/allformats.c --- ffmpeg-git--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-git/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-git--orig/libavformat/rawenc.c ffmpeg-git/libavformat/rawenc.c --- ffmpeg-git--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-git/libavformat/rawenc.c2015-04-05$ 02:33:53.0 +0200 @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] ffserver jpg patch
File /tmp/cam.ffm #when remarked, no file is beeing created and the stream keeps working!! FileMaxSize 400K # Only allow connections from localhost to the feed. ACL allow 127.0.0.1 ACL allow 192.168.1.2 192.168.1.49 Feed cam.ffm Format jpeg VideoFrameRate 2 VideoIntraOnly VideoQmin 1 VideoQMax 5 VideoSize 960x720 NoAudio Strict -1 For the authorship, I didn't make the patch, so I don't think I can be author. Can you edit in the guy who originally submitted the patch from http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2006-June/013107.html ? Patch looks OK at a first glance. Any chance you can attach the relevant feed and stream sections of the ffserver.conf file you used in your tests? Also, it would be great if you can use git format-patch with your email/name so we can preserve autorship information on the commit. Bests, ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] ffserver jpg patch
When can the patch be applied? On Mon, May 04, 2015 at 06:35:36PM -0600, ill wrote: I changed it to git and add the .write header to the last part. The first part compiled after I changed ffserver.c, so it is no longer corrupted. Muxer detection seems to work when I tried it for the middle part. It should be good to fix ffserver now? patch is still corrupted by linebreaks probably your MUA is breaking long lines, try to attach the patch or use git send-email [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel diff -Nrup ffmpeg-git--orig/ffserver.c ffmpeg-git/ffserver.c --- ffmpeg-git--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-git--orig/ffserver_config.c ffmpeg-git/ffserver_config.c --- ffmpeg-git--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-git--orig/ffserver_config.h ffmpeg-git/ffserver_config.h --- ffmpeg-git--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-git--orig/libavformat/allformats.c ffmpeg-git/libavformat/allformats.c --- ffmpeg-git--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-git/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-git--orig/libavformat/rawenc.c ffmpeg-git/libavformat/rawenc.c --- ffmpeg-git--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-git/libavformat/rawenc.c2015-04-05$ 02:33:53.0 +0200 @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] ffserver jpg patch
Can the patch be applied now? On Mon, May 04, 2015 at 06:35:36PM -0600, ill wrote: I changed it to git and add the .write header to the last part. The first part compiled after I changed ffserver.c, so it is no longer corrupted. Muxer detection seems to work when I tried it for the middle part. It should be good to fix ffserver now? patch is still corrupted by linebreaks probably your MUA is breaking long lines, try to attach the patch or use git send-email [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel diff -Nrup ffmpeg-git--orig/ffserver.c ffmpeg-git/ffserver.c --- ffmpeg-git--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-git--orig/ffserver_config.c ffmpeg-git/ffserver_config.c --- ffmpeg-git--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-git--orig/ffserver_config.h ffmpeg-git/ffserver_config.h --- ffmpeg-git--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-git--orig/libavformat/allformats.c ffmpeg-git/libavformat/allformats.c --- ffmpeg-git--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-git/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-git--orig/libavformat/rawenc.c ffmpeg-git/libavformat/rawenc.c --- ffmpeg-git--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-git/libavformat/rawenc.c2015-04-05$ 02:33:53.0 +0200 @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] ffserver jpg patch
It applies for me. Konsole output $ patch -p1 I still haven't gotten a reply about the author. Can I just set the author as anybody or does it have to be someone specific? On Sun, May 10, 2015 at 07:20:02PM -0600, ill wrote: Can the patch be applied now? please provide a patch which applies this one does not (see below) also make sure the patch is a proper git patch for example one generated by "git format-patch -1" also please make sure it has a matching commit message and a correctly set author (this is important) Applying: ffserver jpg patch fatal: patch fragment without header at line 20: @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( Patch failed at 0001 ffserver jpg patch The copy of the patch that failed is found in: ffmpeg/.git/rebase-apply/patch [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] ffserver jpg patch
That is what I sent. It is the same file. I have run the git format-patch -1 on this as well, not that the command seems to do anything to the patch file itself. On Sun, 10 May 2015 22:31:27 -0600 ill wrote: It applies for me. Konsole output $ patch -p1 You are supposed to send this patch instead of your broken "manual" patch. Or is michaelni supposed to fix your broken patch by hand? I'm sure you don't actually want to torture him. I still haven't gotten a reply about the author. Can I just set the author as anybody or does it have to be someone specific? The author field is for attribution and copyright. It should have the correct name, whatever that is. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel diff -Nrup ffmpeg-git--orig/ffserver.c ffmpeg-git/ffserver.c --- ffmpeg-git--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-git--orig/ffserver_config.c ffmpeg-git/ffserver_config.c --- ffmpeg-git--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-git--orig/ffserver_config.h ffmpeg-git/ffserver_config.h --- ffmpeg-git--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-git/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-git--orig/libavformat/allformats.c ffmpeg-git/libavformat/allformats.c --- ffmpeg-git--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-git/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-git--orig/libavformat/rawenc.c ffmpeg-git/libavformat/rawenc.c --- ffmpeg-git--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-git/libavformat/rawenc.c2015-04-05$ 02:33:53.0 +0200 @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] ffserver jpg patch
I attached the file made by Konsole output git commit -p and then the format patch command. I wrote that caligula person as the author because he was the one who posted the modified code stuff that I used. On Mon, May 11, 2015 at 05:02:34PM -0600, ill wrote: That is what I sent. It is the same file. I have run the git format-patch -1 on this as well, not that the command seems to do anything to the patch file itself. you would have to attach the file generated by git format-patch also you of course first need to locally commit your changes and set the commit message and author see man git commit [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >From 5b681fdaf7971f841b84cfe06412c67ba417fb00 Mon Sep 17 00:00:00 2001 From: Caligula useraccount Date: Mon, 11 May 2015 17:42:42 -0600 Subject: [PATCH] ffserver jpg patch --- ffserver.c | 4 ffserver_config.c| 6 -- ffserver_config.h| 1 + libavformat/allformats.c | 1 + libavformat/rawenc.c | 12 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 4803b96..2b99241 100644 --- a/ffserver.c +++ b/ffserver.c @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext *c) /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff --git a/ffserver_config.c b/ffserver_config.c index 017af48..06bd8ac 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff --git a/ffserver_config.h b/ffserver_config.h index bdeb3c9..1b12194 100644 --- a/ffserver_config.h +++ b/ffserver_config.h @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff --git a/libavformat/allformats.c b/libavformat/allformats.c index e6a9d01..2c78e39 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index 9b77cdc..9f1fab7 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] ffserver jpg patch
So it the patch good now? It has authors and everything. On Mon, May 11, 2015 at 05:02:34PM -0600, ill wrote: That is what I sent. It is the same file. I have run the git format-patch -1 on this as well, not that the command seems to do anything to the patch file itself. you would have to attach the file generated by git format-patch also you of course first need to locally commit your changes and set the commit message and author see man git commit [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >From 5b681fdaf7971f841b84cfe06412c67ba417fb00 Mon Sep 17 00:00:00 2001 From: Caligula useraccount Date: Mon, 11 May 2015 17:42:42 -0600 Subject: [PATCH] ffserver jpg patch --- ffserver.c | 4 ffserver_config.c| 6 -- ffserver_config.h| 1 + libavformat/allformats.c | 1 + libavformat/rawenc.c | 12 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 4803b96..2b99241 100644 --- a/ffserver.c +++ b/ffserver.c @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext *c) /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff --git a/ffserver_config.c b/ffserver_config.c index 017af48..06bd8ac 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff --git a/ffserver_config.h b/ffserver_config.h index bdeb3c9..1b12194 100644 --- a/ffserver_config.h +++ b/ffserver_config.h @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff --git a/libavformat/allformats.c b/libavformat/allformats.c index e6a9d01..2c78e39 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index 9b77cdc..9f1fab7 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] ffserver jpg patch
That file is attached you would have to attach the file generated by git format-patch also you of course first need to locally commit your changes and set the commit message and author see man git commit [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >From 5b681fdaf7971f841b84cfe06412c67ba417fb00 Mon Sep 17 00:00:00 2001 From: Caligula useraccount Date: Mon, 11 May 2015 17:42:42 -0600 Subject: [PATCH] ffserver jpg patch --- ffserver.c | 4 ffserver_config.c| 6 -- ffserver_config.h| 1 + libavformat/allformats.c | 1 + libavformat/rawenc.c | 12 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 4803b96..2b99241 100644 --- a/ffserver.c +++ b/ffserver.c @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext *c) /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff --git a/ffserver_config.c b/ffserver_config.c index 017af48..06bd8ac 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff --git a/ffserver_config.h b/ffserver_config.h index bdeb3c9..1b12194 100644 --- a/ffserver_config.h +++ b/ffserver_config.h @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff --git a/libavformat/allformats.c b/libavformat/allformats.c index e6a9d01..2c78e39 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index 9b77cdc..9f1fab7 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] ffserver jpg patch
That file is attached you would have to attach the file generated by git format-patch also you of course first need to locally commit your changes and set the commit message and author see man git commit [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel >From 5b681fdaf7971f841b84cfe06412c67ba417fb00 Mon Sep 17 00:00:00 2001 From: Caligula useraccount Date: Mon, 11 May 2015 17:42:42 -0600 Subject: [PATCH] ffserver jpg patch --- ffserver.c | 4 ffserver_config.c| 6 -- ffserver_config.h| 1 + libavformat/allformats.c | 1 + libavformat/rawenc.c | 12 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 4803b96..2b99241 100644 --- a/ffserver.c +++ b/ffserver.c @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext *c) /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff --git a/ffserver_config.c b/ffserver_config.c index 017af48..06bd8ac 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff --git a/ffserver_config.h b/ffserver_config.h index bdeb3c9..1b12194 100644 --- a/ffserver_config.h +++ b/ffserver_config.h @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff --git a/libavformat/allformats.c b/libavformat/allformats.c index e6a9d01..2c78e39 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index 9b77cdc..9f1fab7 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffserver regression jpg fix for mjpg streaming data sent to browser instead of jpg image
That file is attached you would have to attach the file generated by git format-patch also you of course first need to locally commit your changes and set the commit message and author see man git commit [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ffserver.c |4 ffserver_config.c|6 -- ffserver_config.h|1 + libavformat/allformats.c |1 + libavformat/rawenc.c | 12 5 files changed, 22 insertions(+), 2 deletions(-) 45033f4565049ec4b1893023d52ce1799610a902 0001-ffserver-jpg-patch.patch From 5b681fdaf7971f841b84cfe06412c67ba417fb00 Mon Sep 17 00:00:00 2001 From: Caligula useraccount Date: Mon, 11 May 2015 17:42:42 -0600 Subject: [PATCH] ffserver jpg patch the commit message should describe what the commit does how it does it and why it does It fixes a regression that ffserver doesn't use jpg for said format. --- ffserver.c | 4 ffserver_config.c| 6 -- ffserver_config.h| 1 + libavformat/allformats.c | 1 + libavformat/rawenc.c | 12 changes to libavformat and ffserver should be in seperate patches ideally Do you have experience in that? I tried cutting and pasting the libavformat parts to a different patch but that makes it not work. Is that a strict requirement? I think the changes don't work separately. also please see http://ffmpeg.org/developer.html#New-codecs-or-formats-checklist It's not a new codec or format. All it does is fix an already existing format (jpg) I also don't know what 90% of the stuff it is talking about on that page is, but it does compile and fixes the bug, so 12 is good, and I think 4. Thanks [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH] ffserver regression jpg fix for mjpg streaming data sent to browser instead of jpg image
That file is attached you would have to attach the file generated by git format-patch also you of course first need to locally commit your changes and set the commit message and author see man git commit [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ffserver.c |4 ffserver_config.c|6 -- ffserver_config.h|1 + libavformat/allformats.c |1 + libavformat/rawenc.c | 12 5 files changed, 22 insertions(+), 2 deletions(-) 45033f4565049ec4b1893023d52ce1799610a902 0001-ffserver-jpg-patch.patch From 5b681fdaf7971f841b84cfe06412c67ba417fb00 Mon Sep 17 00:00:00 2001 From: Caligula useraccount Date: Mon, 11 May 2015 17:42:42 -0600 Subject: [PATCH] ffserver jpg patch the commit message should describe what the commit does how it does it and why it does It fixes a regression that ffserver doesn't use jpg for said format. --- ffserver.c | 4 ffserver_config.c| 6 -- ffserver_config.h| 1 + libavformat/allformats.c | 1 + libavformat/rawenc.c | 12 changes to libavformat and ffserver should be in seperate patches ideally Do you have experience in that? I tried cutting and pasting the libavformat parts to a different patch but that makes it not work. Is that a strict requirement? I think the changes don't work separately. also please see http://ffmpeg.org/developer.html#New-codecs-or-formats-checklist It's not a new codec or format. All it does is fix an already existing format (jpg) I also don't know what 90% of the stuff it is talking about on that page is, but it does compile and fixes the bug, so 12 is good, and I think 4. Thanks [...] ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] patch ffserver
So can the ffserver patch be committed? >From 5b681fdaf7971f841b84cfe06412c67ba417fb00 Mon Sep 17 00:00:00 2001 From: Caligula useraccount Date: Mon, 11 May 2015 17:42:42 -0600 Subject: [PATCH] ffserver jpg patch --- ffserver.c | 4 ffserver_config.c| 6 -- ffserver_config.h| 1 + libavformat/allformats.c | 1 + libavformat/rawenc.c | 12 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ffserver.c b/ffserver.c index 4803b96..2b99241 100644 --- a/ffserver.c +++ b/ffserver.c @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext *c) /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff --git a/ffserver_config.c b/ffserver_config.c index 017af48..06bd8ac 100644 --- a/ffserver_config.c +++ b/ffserver_config.c @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream(FFServerConfig *config, const char *cmd, } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff --git a/ffserver_config.h b/ffserver_config.h index bdeb3c9..1b12194 100644 --- a/ffserver_config.h +++ b/ffserver_config.h @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff --git a/libavformat/allformats.c b/libavformat/allformats.c index e6a9d01..2c78e39 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff --git a/libavformat/rawenc.c b/libavformat/rawenc.c index 9b77cdc..9f1fab7 100644 --- a/libavformat/rawenc.c +++ b/libavformat/rawenc.c @@ -250,6 +250,18 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +.write_header = force_one_stream, +}; #endif #if CONFIG_MLP_MUXER -- 2.1.4 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] ffserver jpg output
The jpg output plugin is outputting a stream (with no mimetype) instead of an image file, so browsers like firefox can't view it properly and try to download it or try to grab the never ending stream instead of just a single image. There was a patch to fix this, but I don't think it was ever applied: http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2006-June/013107.html Can that be applied now to fix it so jpg has boundaries with mimetype? ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] ffserver jpg output
There was a patch to fix this, but I don't think it was ever applied: http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2006-June/013107.html Did you test the patch? Carl Eugen No. I don't know if it works and don't really know how to apply it. It's also a bit old. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] ffserver jpg output
So can this be applied to ffserver and put in the git? Ave all Background: I'm using ffserver, which feeds of a webcam, to serve .swf and .jpg files. To serve the .jpg files, I use the patch mentioned in http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2006-June/013107.html Over the years I "ported" the patch to more current versions of ffmpeg. Attached is a patch for 2.6.x, older versions are available at http://sarijopen.student.utwente.nl/caligula/ffmpeg/ Greetings Martijn (Who hopes that ffserver is kept alive) diff -Nrup ffmpeg-2.6.1--orig/ffserver.c ffmpeg-2.6.1/ffserver.c --- ffmpeg-2.6.1--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.c ffmpeg-2.6.1/ffserver_config.c --- ffmpeg-2.6.1--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.h ffmpeg-2.6.1/ffserver_config.h --- ffmpeg-2.6.1--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-2.6.1--orig/libavformat/allformats.c ffmpeg-2.6.1/libavformat/allformats.c --- ffmpeg-2.6.1--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-2.6.1/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-2.6.1--orig/libavformat/rawenc.c ffmpeg-2.6.1/libavformat/rawenc.c --- ffmpeg-2.6.1--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-2.6.1/libavformat/rawenc.c2015-04-05 02:33:53.0 +0200 @@ -250,6 +250,17 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] ffserver jpg output
Who is in charge of committing the patches? This patch fixes bugs, so I don't see why it should be ignored. Ave all Background: I'm using ffserver, which feeds of a webcam, to serve .swf and .jpg files. To serve the .jpg files, I use the patch mentioned in http://lists.ffmpeg.org/pipermail/ffmpeg-devel/2006-June/013107.html Over the years I "ported" the patch to more current versions of ffmpeg. Attached is a patch for 2.6.x, older versions are available at http://sarijopen.student.utwente.nl/caligula/ffmpeg/ Greetings Martijn (Who hopes that ffserver is kept alive) diff -Nrup ffmpeg-2.6.1--orig/ffserver.c ffmpeg-2.6.1/ffserver.c --- ffmpeg-2.6.1--orig/ffserver.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver.c2015-04-05 02:33:53.0 +0200 @@ -967,6 +967,10 @@ static int handle_connection(HTTPContext /* close connection if trailer sent */ if (c->state == HTTPSTATE_SEND_DATA_TRAILER) return -1; +/* Check if it is a single jpeg frame 123 */ +if (c->stream->single_frame && c->data_count > c->cur_frame_bytes && c->cur_frame_bytes > 0) { +close_connection(c); +} break; case HTTPSTATE_RECEIVE_DATA: /* no need to read if no events */ diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.c ffmpeg-2.6.1/ffserver_config.c --- ffmpeg-2.6.1--orig/ffserver_config.c2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver_config.c2015-04-05 02:33:53.0 +0200 @@ -862,8 +862,10 @@ static int ffserver_parse_config_stream( } else { stream->stream_type = STREAM_TYPE_LIVE; /* JPEG cannot be used here, so use single frame MJPEG */ -if (!strcmp(arg, "jpeg")) -strcpy(arg, "mjpeg"); +if (!strcmp(arg, "jpeg")) { +strcpy(arg, "singlejpeg"); +stream->single_frame=1; +} stream->fmt = ffserver_guess_format(arg, NULL, NULL); if (!stream->fmt) ERROR("Unknown Format: '%s'\n", arg); diff -Nrup ffmpeg-2.6.1--orig/ffserver_config.h ffmpeg-2.6.1/ffserver_config.h --- ffmpeg-2.6.1--orig/ffserver_config.h2015-03-16 20:25:48.0 +0100 +++ ffmpeg-2.6.1/ffserver_config.h2015-04-05 02:33:53.0 +0200 @@ -79,6 +79,7 @@ typedef struct FFServerStream { int multicast_port; /* first port used for multicast */ int multicast_ttl; int loop; /* if true, send the stream in loops (only meaningful if file) */ +char single_frame;/* only single frame */ /* feed specific */ int feed_opened; /* true if someone is writing to the feed */ diff -Nrup ffmpeg-2.6.1--orig/libavformat/allformats.c ffmpeg-2.6.1/libavformat/allformats.c --- ffmpeg-2.6.1--orig/libavformat/allformats.c2015-03-16 20:25:52.0 +0100 +++ ffmpeg-2.6.1/libavformat/allformats.c2015-04-05 02:33:53.0 +0200 @@ -273,6 +273,7 @@ void av_register_all(void) REGISTER_MUXER (SEGMENT, stream_segment); REGISTER_DEMUXER (SHORTEN, shorten); REGISTER_DEMUXER (SIFF, siff); +REGISTER_MUXER (SINGLEJPEG, singlejpeg); REGISTER_DEMUXER (SLN, sln); REGISTER_DEMUXER (SMACKER, smacker); REGISTER_MUXDEMUX(SMJPEG, smjpeg); diff -Nrup ffmpeg-2.6.1--orig/libavformat/rawenc.c ffmpeg-2.6.1/libavformat/rawenc.c --- ffmpeg-2.6.1--orig/libavformat/rawenc.c2015-03-16 20:25:54.0 +0100 +++ ffmpeg-2.6.1/libavformat/rawenc.c2015-04-05 02:33:53.0 +0200 @@ -250,6 +250,17 @@ AVOutputFormat ff_mjpeg_muxer = { .write_packet = ff_raw_write_packet, .flags = AVFMT_NOTIMESTAMPS, }; + +AVOutputFormat ff_singlejpeg_muxer = { +.name = "singlejpeg", +.long_name = NULL_IF_CONFIG_SMALL("JPEG single image"), +.mime_type = "image/jpeg", +.extensions= "jpg,jpeg", +.audio_codec = AV_CODEC_ID_NONE, +.video_codec = AV_CODEC_ID_MJPEG, +.write_packet = ff_raw_write_packet, +.flags = AVFMT_NOTIMESTAMPS, +}; #endif #if CONFIG_MLP_MUXER ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel