Hi there,

I'm generating hls streams with ffmpeg and I want to set the first frame of
video for all streams with a static pts. This can be zero or anything else,
as long as it's the same value for all streams. But my attempts to use the
setpts/asetpts filters to achieve this haven't been successful.

Here is my command:

ffmpeg -y -v info \

-ss 00:00:00.000 -t 00:00:05.000 -i /input/input.mxf \

-filter_complex \

"[0:v:0][0:a:0][0:a:1][0:a:2][0:a:3][0:a:4][0:a:5][0:a:6][0:a:7]concat=n=1:v=1:a=8[vconcat][aconcat0][aconcat1][aconcat2][aconcat3][aconcat4][aconcat5][aconcat6][aconcat7];
\

[aconcat6][aconcat7]join=inputs=2:channel_layout=stereo[t7_8]; \

[aconcat4][aconcat5]join=inputs=2:channel_layout=stereo[t5_6]; \

[aconcat2][aconcat3]join=inputs=2:channel_layout=stereo[t3_4]; \

[aconcat0][aconcat1]join=inputs=2:channel_layout=stereo[t1_2]; \

[t7_8]asetpts=PTS-STARTPTS[t7_8setpts]; \

[t5_6]asetpts=PTS-STARTPTS[t5_6setpts]; \

[t3_4]asetpts=PTS-STARTPTS[t3_4setpts]; \

[t1_2]asetpts=PTS-STARTPTS[t1_2setpts]; \

[vconcat]format=pix_fmts=yuv420p[vconcat420]; \

[vconcat420]yadif=0:-1:0[vconcatdeint];

[vconcatdeint]setpts=PTS-STARTPTS[vconcatdeintsetpts]" \

-map "[t7_8setpts]" -f hls -hls_list_size 0 -hls_time 3.84 -vn -acodec
libfdk_aac /output/TEST01_T4_Audio.m3u8 \

-map "[t5_6setpts]" -f hls -hls_list_size 0 -hls_time 3.84 -vn -acodec
libfdk_aac /output/TEST01_T3_Audio.m3u8 \

-map "[t3_4setpts]" -f hls -hls_list_size 0 -hls_time 3.84 -vn -acodec
libfdk_aac /output/TEST01_T2_Audio.m3u8 \

-map "[t1_2setpts]" -f hls -hls_list_size 0 -hls_time 3.84 -vn -acodec
libfdk_aac /output/TEST01_T1_Audio.m3u8 \

-map "[vconcatdeintsetpts]" -f hls -hls_list_size 0 -hls_time 3.84 -an
-vcodec libx264 -aspect 16:9 -flags +cgop -g 48 -bf 0 -b:v 2M -maxrate 3M
-x264opts keyint=48:min-keyint=48:scenecut=-1 \
/output/TEST01_T0_Video.m3u8

I'm expecting the pts of the first output video frame to be 0.
I check this using the command:

ffprobe -show_frames /output/TEST01_T0_Video0.ts >
/output/ffprobe_video_output_setpts0.txt


But, however I configure my setpts filter, the pts of the first frame is
always 126000:


[FRAME]

media_type=video

stream_index=0

key_frame=1

pts=126000


In addition, when I run the ffpmeg command, I notice this in the console
output:


  asetpts:default -> Stream #0:0 (libfdk_aac)

  asetpts:default -> Stream #1:0 (libfdk_aac)

  asetpts:default -> Stream #2:0 (libfdk_aac)

  asetpts:default -> Stream #3:0 (libfdk_aac)

  setpts:default -> Stream #4:0 (libx264)


So my questions are please:


1. Why isn't the setpts filter working as I expect it to?

2. Why does the pts of the first frame default to 126000?

3. Given that a consistent pts value of 126000 would work fine for me, as
long as I can be confident that it will never be anything else, can I rely
on the first frame pts always being 126000 if I omit the pts filter
altogether?


Many thanks in advance!

Bruce.
_______________________________________________
ffmpeg-user mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to