Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frame accuracy is missing with clipTo #1565

Open
kousthub97 opened this issue Feb 24, 2025 · 0 comments
Open

Frame accuracy is missing with clipTo #1565

kousthub97 opened this issue Feb 24, 2025 · 0 comments

Comments

@kousthub97
Copy link

kousthub97 commented Feb 24, 2025

Hello,

Configured the Kaltura with mapped mode with below configuration and clipping the video starting from I frame.

location /hlsfps_test
                {

                        vod hls;
                        vod_hls_absolute_master_urls off;
                        vod_hls_absolute_index_urls off;
                        vod_hls_absolute_iframe_urls off;
                        vod_hls_index_file_name_prefix "chunklist_";
                        vod_align_segments_to_key_frames on;
                        vod_manifest_segment_durations_mode accurate;

                        secure_token_types application/vnd.apple.mpegurl application/dash+xml text/xml;
                        secure_token $args;


                        #vod_hls_container_format fmp4;
                        #vod_hls_force_unmuxed_segments on;
                        vod_drm_enabled off;
                        vod_drm_single_key off;
                        

                        add_header Access-Control-Allow-Headers "Origin,Range,Accept-Encoding,Referer,Cache-Control";
                        add_header Access-Control-Expose-Headers "Server,Content-Length,Content-Range,Date";
                        add_header Access-Control-Allow-Methods "GET, HEAD, OPTIONS";
                        add_header Access-Control-Allow-Origin "*";
                }

In order to measure the frame accuracy embedded the frame number using ffmpeg in mp4 file(30fps) below command.

ffmpeg -i Big_Buck_Bunny_720_10s_20MB.mp4 -vf "drawtext=fontfile=Arial.ttf: text='%{frame_num}': start_number=1: x=(w-tw)/2: y=h-(2*lh): fontcolor=black: fontsize=20: box=1: boxcolor=white: boxborderw=5" -r 30 -g 60 -keyint_min 60 -sc_threshold Big_Buck_Bunny_720_10s_20MB_emd.mp4

Below is the JSON file:

  {
"discontinuity": true,
  "playlistType": "vod",
  "durations": [
    6766,
    6766
  ],
  "sequences": [
    {
      "clips": [
        {
          "type": "source",
          "path": "http://127.0.0.1:8080/Big_Buck_Bunny_720_10s_20MB_emb.mp4",
          "clipFrom": 0000,
          "clipTo": 6766,
          "tracks": "v1"
        },
	{
          "type": "source",
          "path": "http://127.0.0.1:8080/Big_Buck_Bunny_720_10s_20MB_emb.mp4",
          "clipFrom": 0000,
          "clipTo": 6766,
          "tracks": "v1"
        }
      ]
    }
  ]
}

When I tried to HLS playback frame 202 having 203 frame and 204 having 205 frame number. This I had verified by collected HLS stream as mp4 and converted mp4 each frame as jpg.

ffmpeg -i "http://127.0.0.1:81/hlsfps_test/jsons/751927.json/master.m3u8" -c copy testbig.mp4
ffmpeg -i ../../../testbig.mp4 -q:v 2 jpg/output_%04d.jpg 

Please find the attached Input and output mp4 file(HLS to mp4).
https://github.com/user-attachments/assets/3b45c355-139f-414c-adb3-e0494ba0506a
https://github.com/user-attachments/assets/de029fac-2ab5-48b8-a042-f003beea8376

Please let me know any more info is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant