Hi Mika,

On Tue, 2 Sep 2014, Mika Raento wrote:

This creates best-effort results from input that is missing stream
contents, there are warnings printed when this happens.
---
tools/ismindex.c | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/tools/ismindex.c b/tools/ismindex.c
index f49916a..d91925e 100644
--- a/tools/ismindex.c
+++ b/tools/ismindex.c
@@ -504,6 +504,10 @@ static void output_client_manifest(struct Tracks *tracks, 
const char *basename,
            track = tracks->tracks[i];
            if (!track->is_video)
                continue;
+            if (track->bitrate == 0) {
+                fprintf(stderr, "Skipping video track %d as it has zero 
bitrate\n", i);
+                continue;
+            }
            fprintf(out,
                    "\t\t<QualityLevel Index=\"%d\" Bitrate=\"%d\" "
                    "FourCC=\"%s\" MaxWidth=\"%d\" MaxHeight=\"%d\" "

Is there any reason to only do this for video tracks? I guess the same logic goes for audio as well?

Originally I was a bit hesitant, fearing that this accidentally would skip some valid tracks, but this probably wouldn't work if the bitrate isn't known, and IIRC the mov demuxer should always set it, so it probably is ok.

Should the same logic be used somewhere when splitting ismv files into individual fragment files as well?

@@ -516,6 +520,10 @@ static void output_client_manifest(struct Tracks *tracks, 
const char *basename,
            if (track->chunks != first_track->chunks)
                fprintf(stderr, "Mismatched number of video chunks in %s (id: %d, 
chunks %d) and %s (id: %d, chunks %d)\n",
                        track->name, track->track_id, track->chunks, 
first_track->name, first_track->track_id, first_track->chunks);
+            if (track->chunks > first_track->chunks) {
+                first_track = track;
+                tracks->video_track = i;
+            }
        }

Same here, I guess the same logic should be used for audio tracks as well?

Or would it be even better to add the bit_rate <= 0 check in handle_file instead? In that case we should get away with just one single check, for both audio and video, and for both splitting and generating ismc files.

// Martin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to