Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

FFprobeKit.execute is returning logs from the previous command #571

@francescov1

Description

@francescov1

Description
When I run the following code, the logs from the first ffprobe command are returned for the second command as well. It seems that FFprobeKit.execute is either returning the previous session, or running the previous command.

  let session1 = FFprobeKit.execute("-loglevel error -count_packets -show_entries stream:format \"\(inputFilePath)\"")
  let logs1 = session1?.getAllLogsAsString()
  print("LOGS 1: \(logs1)")
  
  let session2 = FFprobeKit.execute("-loglevel error \"\(inputFilePath)\"")
  let logs2 = session2?.getAllLogsAsString()
  print("LOGS 2: \(logs2)") // This prints the same as logs1, even though it should be completely different

This occurs whether I use getAllLogsAsString, getLogsAsString or getOutput. If I remove -show_entries stream:format from the first command, the issue does not occur anymore.

Expected behavior
The proper logs are returned

Current behavior
Logs from the previous ffprobe command are returned instead

To Reproduce
Run the code above

Screenshots
If applicable, add screenshots to help explain your problem.

Logs

These are the logs from the code shown above. The second command should only return an empty string (or an error) but instead it returns the stream information fetched from the first command.

LOGS 1: Optional("[STREAM]\nindex=0\ncodec_name=h264\ncodec_long_name=unknown\nprofile=77\ncodec_type=video\ncodec_tag_string=avc1\ncodec_tag=0x31637661\nwidth=3360\nheight=2100\ncoded_width=3360\ncoded_height=2100\nclosed_captions=0\nhas_b_frames=1\nsample_aspect_ratio=1:1\ndisplay_aspect_ratio=8:5\npix_fmt=yuv420p\nlevel=52\ncolor_range=tv\ncolor_space=bt709\ncolor_transfer=bt709\ncolor_primaries=bt709\nchroma_location=bottom\nfield_order=progressive\nrefs=1\nis_avc=true\nnal_length_size=4\nid=0x1\nr_frame_rate=60/1\navg_frame_rate=5325/146\ntime_base=1/12000\nstart_pts=0\nstart_time=0.000000\nduration_ts=116600\nduration=9.716667\nbit_rate=19186307\nmax_bit_rate=N/A\nbits_per_raw_sample=8\nnb_frames=355\nnb_read_frames=N/A\nnb_read_packets=355\nDISPOSITION:default=1\nDISPOSITION:dub=0\nDISPOSITION:original=0\nDISPOSITION:comment=0\nDISPOSITION:lyrics=0\nDISPOSITION:karaoke=0\nDISPOSITION:forced=0\nDISPOSITION:hearing_impaired=0\nDISPOSITION:visual_impaired=0\nDISPOSITION:clean_effects=0\nDISPOSITION:attached_pic=0\nDISPOSITION:timed_thumbnails=0\nDISPOSITION:captions=0\nDISPOSITION:descriptions=0\nDISPOSITION:metadata=0\nDISPOSITION:dependent=0\nDISPOSITION:still_image=0\nTAG:language=und\nTAG:handler_name=Core Media Video\nTAG:vendor_id=[0][0][0][0]\n[/STREAM]\n[FORMAT]\nfilename=/Users/francescovirga/Desktop/QuickTime x264 NativeScreen (No Audio).mp4\nnb_streams=1\nnb_programs=0\nformat_name=mov,mp4,m4a,3gp,3g2,mj2\nformat_long_name=unknown\nstart_time=0.000000\nduration=9.717000\nsize=23310630\nbit_rate=19191627\nprobe_score=100\nTAG:major_brand=isom\nTAG:minor_version=512\nTAG:compatible_brands=isomiso2avc1mp41\nTAG:encoder=Lavf59.10.100\n[/FORMAT]\n")

LOGS 2: Optional("[STREAM]\nindex=0\ncodec_name=h264\ncodec_long_name=unknown\nprofile=77\ncodec_type=video\ncodec_tag_string=avc1\ncodec_tag=0x31637661\nwidth=3360\nheight=2100\ncoded_width=3360\ncoded_height=2100\nclosed_captions=0\nhas_b_frames=1\nsample_aspect_ratio=1:1\ndisplay_aspect_ratio=8:5\npix_fmt=yuv420p\nlevel=52\ncolor_range=tv\ncolor_space=bt709\ncolor_transfer=bt709\ncolor_primaries=bt709\nchroma_location=bottom\nfield_order=progressive\nrefs=1\nis_avc=true\nnal_length_size=4\nid=0x1\nr_frame_rate=60/1\navg_frame_rate=5325/146\ntime_base=1/12000\nstart_pts=0\nstart_time=0.000000\nduration_ts=116600\nduration=9.716667\nbit_rate=19186307\nmax_bit_rate=N/A\nbits_per_raw_sample=8\nnb_frames=355\nnb_read_frames=N/A\nnb_read_packets=N/A\nDISPOSITION:default=1\nDISPOSITION:dub=0\nDISPOSITION:original=0\nDISPOSITION:comment=0\nDISPOSITION:lyrics=0\nDISPOSITION:karaoke=0\nDISPOSITION:forced=0\nDISPOSITION:hearing_impaired=0\nDISPOSITION:visual_impaired=0\nDISPOSITION:clean_effects=0\nDISPOSITION:attached_pic=0\nDISPOSITION:timed_thumbnails=0\nDISPOSITION:captions=0\nDISPOSITION:descriptions=0\nDISPOSITION:metadata=0\nDISPOSITION:dependent=0\nDISPOSITION:still_image=0\nTAG:language=und\nTAG:handler_name=Core Media Video\nTAG:vendor_id=[0][0][0][0]\n[/STREAM]\n[FORMAT]\nfilename=/Users/francescovirga/Desktop/QuickTime x264 NativeScreen (No Audio).mp4\nnb_streams=1\nnb_programs=0\nformat_name=mov,mp4,m4a,3gp,3g2,mj2\nformat_long_name=unknown\nstart_time=0.000000\nduration=9.717000\nsize=23310630\nbit_rate=19191627\nprobe_score=100\nTAG:major_brand=isom\nTAG:minor_version=512\nTAG:compatible_brands=isomiso2avc1mp41\nTAG:encoder=Lavf59.10.100\n[/FORMAT]\n")

Environment

  • Platform: macOS
  • Architecture: x86_64
  • Version: ffmpeg-kit-macos-full-gpl 4.5.1
  • Source branch: main
  • Xcode version: 13.4.1
  • Cocoapods version: 1.11.3

Other
Add any other context about the problem here.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions