#EXTINF - field in apple hls playlist has decimal placed duration - generated by mediafilesegmenter - http-live-streaming

I am using mediafilesegmenter to generate HLS playlists for mp4 movies. My command is as follows,
mediafilesegmenter movieName.mp4 -I -f /Library/WebServer/Documents/vod/movieName/ -t 10 -l movie.log -k /Library/WebServer/Documents/vod/movieName/keys/ -K http://KEYSERVER/keys/ -key-rotation-period 10 -encrypt-rotate-iv-mbytes=1024 -J random
Through this command i am getting playlist generated fine, but the duration in #EXTINF: is decimal placed. I did checked the HLS draft, it says
The EXTINF tag specifies the duration of a media segment. It applies
only to the media URI that follows it. Each media segment URI MUST
be preceded by an EXTINF tag. Its format is:
#EXTINF:<duration>,<title>
>
"duration" is an integer or floating-point number in decimal
positional notation that specifies the duration of the media segment
in seconds. Durations that are reported as integers SHOULD be
rounded to the nearest integer. Durations MUST be integers if the
protocol version of the Playlist file is less than 3.
My question is How can i make #EXTINF to whole integer? I did used the option -t 10 and -t 15 and several numbers, but still my playlist has
#EXTINF:14.792, etc.
Can anybody point me what changes in the command to be made so that i get whole integer based #EXTINF ?
My mediasegmenter version is mediafilesegmenter: Beta Version 1.1(111116)
I am using Darwin Kernel Version 10.8.0 with x86_64 mac.

There is now a proper solution provided by Apple. You should use this flag to the mediafilesegmenter tool.
-no-floating-point-duration

Related

Why AWS MEDIACONVERT set EXTINF in m3u8 file equals to source video duration +1 sec?

I have a source mp4 file with duration=17sec (for example).
When i convert video to Apple HLS using AWS MediaConvert, i get the m3u8 file with duration 18sec .
I mean #EXTINF:18 tag in m3u8.
I use ABR mode.
SegmentControl settings are default
{
"OutputGroups": [
{
"Name": "Apple HLS",
"OutputGroupSettings": {
"Type": "HLS_GROUP_SETTINGS",
"HlsGroupSettings": {
"SegmentLength": 10,
"MinSegmentLength": 0,
"TargetDurationCompatibilityMode": "LEGACY",
"SegmentLengthControl": "GOP_MULTIPLE",
"SegmentControl": "SEGMENTED_FILES"
}
}
]
}
How to fix it? I tried to change different HlsGroupSettings but result remains the same
Thanks for your post. MediaConvert has a default setting to use whole integers for manifest durations. This means that if the source asset has even 1 extra frame of video or audio, the service will add a whole second to the segment duration. This may be why your output is appearing to be +1s longer than expected. You can change this segment duration setting to 'floating point' duration under "HLS Output Group / Avanced/ Manifest duration format". Try this and you might find the last segment is only slightly longer than expected.
You can ensure the source asset is exactly XX seconds long using the "input Clips" feature to specify a specific start + end timecode (HH:MM::SS:FF).
For the widest compatibility with streaming players we recommend using 1 second as the minimum segment duration. Very short segments (<1s) sometimes get skipped by some players or flagged by stream quality checking products. If a few extra frames of source content are found to exist, they will get added to the previous segment.
When measuring durations, be sure to check the actual media track durations and not just the file header metadata. Utilities such as ffprobe or mediainfo (use the --full flag) are helpful for this. The pts_time for each frame will indicate when it is supposed to start. The pkt_duration_time will indicate the duration of each frame.

MPEG-DASH: generating a single mpd and corresponding segments for multi-bitrate videos

Hi I have a single video which is re-encoded to various bit rates.
I have generated the corresponding mpd file also.It plays using MP4Client.
I used the following command:
MP4Box -dash 4000 -frag 4000 -rap -profile onDemand -segment-name %s/segment_ -url-template -out manifest.mpd video-240.mp4#video video-360.mp4#video video-480.mp4#video video-720.mp4#video video-audio.mp4#audio
But it generates only a single segment for each bit rate.I want to generate the corresponding segments(i.e segment list) also for all the bit rates.
Any help will be really useful.
I have set the profile to simple and now it works!

Debug manifest .mpd

After activating CORS on my webserver I have run my manifest on dash conformance webtool finding several errors that I can not interpret, at the moment I am not able to get the ABR behavior,Can i ask for help to understand how to fix the bug?
https://allibrante.com/live/manifest.mpd
Below some log reported from the Dash confromance webtool, for more details is better run the manifest on their webtool
Thanks a lot!
error: moov-1:trak-1:mdia-1:minf-1:stbl-1:stsd-1
SampleDescription sdType must be 'mp4v', 'avc1', 'encv', 'hev1','hvc1', or 'vp09'('mp4v', 'avc1', 'encv', 'hev1','hvc1','vp09')
Warning: Unknown atom found "avcC": video sample descriptions would
not normally contain this Warning: Unknown atom found "pasp": video
sample descriptions would not normally contain this Brand 'lmsg' not
found as a compatible brand for the last segment (number 3); violates
Section 3.2.3. of Interoperability Point DASH264: If the MPD#type is
equal to "dynamic" or if it includes MPD#profile attribute in-cludes
"urn:mpeg:dash:profile:isoff-live:2011", then: if the Media Segment is
the last Media Segment in the Representation, this Me-dia Segment
shall carry the 'lmsg' compatibility brand tfdt base media decode time
1658.000000 not equal to accumulated decode time 0.000000 for track 1 for the first fragment of the movie. This software does not handle
incomplete presentations. Applying correction.
error:
Buffer underrun conformance error: first (and only one reported here) for sample 1 of run 1 of track fragment 1 of fragment 1 of track
id 1 (sample absolute file offset 1356, fragment absolute file offset
860, bandwidth: 7591)
-
'tkhd' alternateGroup must be 0 not 1 Validate_ES_Descriptor: ES_ID
should be 0 not 2 in media tracks
WARNING: unknown sample table atom 'sgpd' WARNING: unknown mvex atom
'trep' WARNING: unknown/unexpected atom 'meta' Brand 'lmsg' not found
as a compatible brand for the last segment (number 3); violates
Section 3.2.3. of Interoperability Point DASH264: If the MPD#type is
equal to "dynamic" or if it includes MPD#profile attribute in-cludes
"urn:mpeg:dash:profile:isoff-live:2011", then: if the Media Segment is
the last Media Segment in the Representation, this Me-dia Segment
shall carry the 'lmsg' compatibility brand tfdt base media decode time
1657.984000 not equal to accumulated decode time 0.000000 for track 2 for the first fragment of the movie. This software does not handle
incomplete presentations. Applying correction.
error:
grouping_type roll in sbgp is not found for any sgpd in moof number 1
error:
grouping_type roll in sbgp is not found for any sgpd in moof number 1
error:
grouping_type roll in sbgp is not found for any sgpd in moof number 1
The cause of the majority of your problems is spelled out in the error message: This software does not handle incomplete presentations. You are trying to validate a live stream, and this tool does not currently have that capability.
With respect to the sample description issue, it looks like the validator does not recognise avc3 content (ie where the parameter sets are inband rather than in the initialisation segment). I would consider this a bug and suggest you raise an issue at https://github.com/Dash-Industry-Forum/Conformance-and-reference-source/issues.

Linux: How to display the date in a different time format using the last command in terminal?

I am trying to display just the time of the last logon of a user.
The goal is to display the time just like
date "+d% %B%t%Y"
would.
I tried:
last -n1 --time-format "+d% %B%t%Y"
but it keeps telling me that it is an unknown time format.
I also tried the ones in the man last examples, none of those formats seem to work. Is there another way of doing this?
The --time-format option only accepts the following options:
--time-format <format> show timestamps in the specified <format>:
notime|short|full|iso
You might have to parse the datetime yourself, for example from ISO format.

imagemagick -morph: increase file number but not consecutive

I've been using imagemagick for a few days. My objective is that I want to merge several screenshots into a video and I want to make a nice transition between frames. So I've found the -morph option, for example
convert original/*.jpg -morph 10 new/img%03d.jpg
which will create a total of 12 images, from img001.jpg to img012.jpg.
Is there a way that the images in the output be like, for example, one every X number? for example img00X.jpg img00(x+x).jpg and so on?
If I understand well your requirements, you want to obtain:
img002.jpg img004.jpg img006.jpg ... img024.jpg
instead of:
img001.jpg img002.jpg img003.jpg ... img012.jpg
I'm not sure you can do it directly with imageMagick, however you can go to your new directory and type:
for i in `ls -r`;do mv $i `printf "img%03d.jpg" $(($(expr ${i:3:3} + 0)*2))`;done
(I assume that there are no other files in this directory)
actually it is possible yet without leading zeroes. for example morph every png with 5 transitions steps and increments output counter by 3
im *.png -morph 5 -set filename:a %[fx:t*3] "output-%[filename:a].jpg"

Resources