dashenc: log file output progress in verbose mode
As the manifest/segments are flushed to disk, log to stderr the progress, when in verbose logging mode Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
		
							parent
							
								
									95d880fa64
								
							
						
					
					
						commit
						fa8934d6d6
					
				| @ -634,6 +634,7 @@ static int dash_write_header(AVFormatContext *s) | |||||||
|             ffurl_close(os->out); |             ffurl_close(os->out); | ||||||
|             os->out = NULL; |             os->out = NULL; | ||||||
|         } |         } | ||||||
|  |         av_log(s, AV_LOG_VERBOSE, "Representation %d init segment written to: %s\n", i, filename); | ||||||
| 
 | 
 | ||||||
|         s->streams[i]->time_base = st->time_base; |         s->streams[i]->time_base = st->time_base; | ||||||
|         // If the muxer wants to shift timestamps, request to have them shifted
 |         // If the muxer wants to shift timestamps, request to have them shifted
 | ||||||
| @ -655,6 +656,8 @@ static int dash_write_header(AVFormatContext *s) | |||||||
|         ret = AVERROR(EINVAL); |         ret = AVERROR(EINVAL); | ||||||
|     } |     } | ||||||
|     ret = write_manifest(s, 0); |     ret = write_manifest(s, 0); | ||||||
|  |     if (!ret) | ||||||
|  |         av_log(s, AV_LOG_VERBOSE, "Manifest written to: %s\n", s->filename); | ||||||
| 
 | 
 | ||||||
| fail: | fail: | ||||||
|     if (ret) |     if (ret) | ||||||
| @ -702,16 +705,13 @@ static void write_styp(AVIOContext *pb) | |||||||
|     ffio_wfourcc(pb, "msix"); |     ffio_wfourcc(pb, "msix"); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void find_index_range(AVFormatContext *s, const char *dirname, | static void find_index_range(AVFormatContext *s, const char *full_path, | ||||||
|                              const char *filename, int64_t pos, |                              int64_t pos, int *index_length) | ||||||
|                              int *index_length) |  | ||||||
| { | { | ||||||
|     char full_path[1024]; |  | ||||||
|     uint8_t buf[8]; |     uint8_t buf[8]; | ||||||
|     URLContext *fd; |     URLContext *fd; | ||||||
|     int ret; |     int ret; | ||||||
| 
 | 
 | ||||||
|     snprintf(full_path, sizeof(full_path), "%s%s", dirname, filename); |  | ||||||
|     ret = ffurl_open(&fd, full_path, AVIO_FLAG_READ, &s->interrupt_callback, NULL); |     ret = ffurl_open(&fd, full_path, AVIO_FLAG_READ, &s->interrupt_callback, NULL); | ||||||
|     if (ret < 0) |     if (ret < 0) | ||||||
|         return; |         return; | ||||||
| @ -765,14 +765,17 @@ static int dash_flush(AVFormatContext *s, int final, int stream) | |||||||
|             if (ret < 0) |             if (ret < 0) | ||||||
|                 break; |                 break; | ||||||
|             write_styp(os->ctx->pb); |             write_styp(os->ctx->pb); | ||||||
|  |         } else { | ||||||
|  |             snprintf(full_path, sizeof(full_path), "%s%s", c->dirname, os->initfile); | ||||||
|         } |         } | ||||||
|  | 
 | ||||||
|         av_write_frame(os->ctx, NULL); |         av_write_frame(os->ctx, NULL); | ||||||
|         avio_flush(os->ctx->pb); |         avio_flush(os->ctx->pb); | ||||||
|         os->packets_written = 0; |         os->packets_written = 0; | ||||||
| 
 | 
 | ||||||
|         range_length = avio_tell(os->ctx->pb) - start_pos; |         range_length = avio_tell(os->ctx->pb) - start_pos; | ||||||
|         if (c->single_file) { |         if (c->single_file) { | ||||||
|             find_index_range(s, c->dirname, os->initfile, start_pos, &index_length); |             find_index_range(s, full_path, start_pos, &index_length); | ||||||
|         } else { |         } else { | ||||||
|             ffurl_close(os->out); |             ffurl_close(os->out); | ||||||
|             os->out = NULL; |             os->out = NULL; | ||||||
| @ -781,6 +784,7 @@ static int dash_flush(AVFormatContext *s, int final, int stream) | |||||||
|                 break; |                 break; | ||||||
|         } |         } | ||||||
|         add_segment(os, filename, os->start_dts, os->end_dts - os->start_dts, start_pos, range_length, index_length); |         add_segment(os, filename, os->start_dts, os->end_dts - os->start_dts, start_pos, range_length, index_length); | ||||||
|  |         av_log(s, AV_LOG_VERBOSE, "Representation %d media segment %d written to: %s\n", i, os->segment_index, full_path); | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (c->window_size || (final && c->remove_at_exit)) { |     if (c->window_size || (final && c->remove_at_exit)) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user