Post

Replies

Boosts

Views

Activity

Unable to export slow mo video with hevc1920x1080 preset and AVExportSession
Hello, I'm implementing video export for uploading to the server and I'm using AVExportSession for achieving it. The session is using AVAssetExportPresetHEVC1920x1080 for all videos. The issue, I'm facing, is the failure to export with the AVFoundation -11800 Unknown error, when I'm trying to export slow motion video to the URL. The export URL has a defined file extension and it is guaranteed, that there is no file at the URL. The AVAsset (AVComposition) for export is requested using the Photos framework with the following video export options: let videoOptions = PHVideoRequestOptions() videoOptions.isNetworkAccessAllowed = true videoOptions.version = .current videoOptions.deliveryMode = .highQualityFormat return videoOptions The only workaround, I found is to export with the AVAssetExportPresetMediumQuality or AVAssetExportPreset1920x1080. None of these approaches suits me, because both presets will encode video to H.264 format, which doesn't make a lot of sense since the video is originally encoded in HEVC format. Is there something, what I'm missing or is it a system bug? Thanks
4
1
1.3k
Sep ’22
UICollectionViewCompositionalLayout
Hello, how should I perform two next two operations with UICompositionalLayout? Scroll To Specific offset Change layout of the item, I'm scrolling to. Whenever I try to call collectionView.collectionViewLayout.invalidateLayout(), I get reset: Content Offset of UICollectionView The layout change of the item is not updated Here is the example of the layout I try to use.    let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),                                           heightDimension: .estimated(100))     let item = NSCollectionLayoutItem(layoutSize: itemSize)     item.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: nil, top: .fixed(8), trailing: nil, bottom: .fixed(8))     let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),                                            heightDimension: .estimated(100))     let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])     let section = NSCollectionLayoutSection(group: group)     return section And here is the example of cell class ReelTextCellView: UICollectionViewCell {   private var textView: UITextView!   private var infoHolderView: UIView!   private var copyButton: UIButton!   private var scrollView: UIScrollView!   private var heightConstraint: NSLayoutConstraint!   var isExpanded = false   override init(frame: CGRect) {     super.init(frame: .zero)     buildView()   }   required init?(coder: NSCoder) {     fatalError("init(coder:) has not been implemented")   }   override func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {     let attributes = super.preferredLayoutAttributesFitting(layoutAttributes)     attributes.frame.size = .init(width: contentView.frame.width, height: isExpanded ? 300 : 100)     return attributes   } // Called with the cellWillAppear and manually for indexPathsForVisibleItems   func update(with appeareance: Appearance) {     isExpanded = appeareance.isExpanded     ///    heightConstraint.constant = appeareance.isExpanded ? 300 : 100   } private extension ReelTextCellView {   func buildView() {     infoHolderView = UIView()     contentView.addSubview(infoHolderView) {       contentView.bottomAnchor.constraint(equalTo: infoHolderView.bottomAnchor)       contentView.leadingAnchor.constraint(equalTo: infoHolderView.leadingAnchor)       contentView.trailingAnchor.constraint(equalTo: infoHolderView.trailingAnchor)       infoHolderView.heightAnchor.constraint(equalToConstant: 30)     }     let separatorView = UIView()     separatorView.backgroundColor = Assets.Colors.separator.color     infoHolderView.addSubview(separatorView) {       separatorView.topAnchor.constraint(equalTo: infoHolderView.topAnchor)       separatorView.leadingAnchor.constraint(equalTo: infoHolderView.leadingAnchor)       separatorView.trailingAnchor.constraint(equalTo: infoHolderView.trailingAnchor)       separatorView.heightAnchor.constraint(equalToConstant: 0.5)     }     textView = UITextView()     contentView.addSubview(textView) {       textView.topAnchor.constraint(equalTo: contentView.topAnchor)       textView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor)       textView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor)       textView.bottomAnchor.constraint(equalTo: infoHolderView.topAnchor)     }   } }
0
0
1.6k
Feb ’22
Unable to export slow mo video with hevc1920x1080 preset and AVExportSession
Hello, I'm implementing video export for uploading to the server and I'm using AVExportSession for achieving it. The session is using AVAssetExportPresetHEVC1920x1080 for all videos. The issue, I'm facing, is the failure to export with the AVFoundation -11800 Unknown error, when I'm trying to export slow motion video to the URL. The export URL has a defined file extension and it is guaranteed, that there is no file at the URL. The AVAsset (AVComposition) for export is requested using the Photos framework with the following video export options: let videoOptions = PHVideoRequestOptions() videoOptions.isNetworkAccessAllowed = true videoOptions.version = .current videoOptions.deliveryMode = .highQualityFormat return videoOptions The only workaround, I found is to export with the AVAssetExportPresetMediumQuality or AVAssetExportPreset1920x1080. None of these approaches suits me, because both presets will encode video to H.264 format, which doesn't make a lot of sense since the video is originally encoded in HEVC format. Is there something, what I'm missing or is it a system bug? Thanks
Replies
4
Boosts
1
Views
1.3k
Activity
Sep ’22
UICollectionViewCompositionalLayout
Hello, how should I perform two next two operations with UICompositionalLayout? Scroll To Specific offset Change layout of the item, I'm scrolling to. Whenever I try to call collectionView.collectionViewLayout.invalidateLayout(), I get reset: Content Offset of UICollectionView The layout change of the item is not updated Here is the example of the layout I try to use.    let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),                                           heightDimension: .estimated(100))     let item = NSCollectionLayoutItem(layoutSize: itemSize)     item.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: nil, top: .fixed(8), trailing: nil, bottom: .fixed(8))     let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1.0),                                            heightDimension: .estimated(100))     let group = NSCollectionLayoutGroup.horizontal(layoutSize: groupSize, subitems: [item])     let section = NSCollectionLayoutSection(group: group)     return section And here is the example of cell class ReelTextCellView: UICollectionViewCell {   private var textView: UITextView!   private var infoHolderView: UIView!   private var copyButton: UIButton!   private var scrollView: UIScrollView!   private var heightConstraint: NSLayoutConstraint!   var isExpanded = false   override init(frame: CGRect) {     super.init(frame: .zero)     buildView()   }   required init?(coder: NSCoder) {     fatalError("init(coder:) has not been implemented")   }   override func preferredLayoutAttributesFitting(_ layoutAttributes: UICollectionViewLayoutAttributes) -> UICollectionViewLayoutAttributes {     let attributes = super.preferredLayoutAttributesFitting(layoutAttributes)     attributes.frame.size = .init(width: contentView.frame.width, height: isExpanded ? 300 : 100)     return attributes   } // Called with the cellWillAppear and manually for indexPathsForVisibleItems   func update(with appeareance: Appearance) {     isExpanded = appeareance.isExpanded     ///    heightConstraint.constant = appeareance.isExpanded ? 300 : 100   } private extension ReelTextCellView {   func buildView() {     infoHolderView = UIView()     contentView.addSubview(infoHolderView) {       contentView.bottomAnchor.constraint(equalTo: infoHolderView.bottomAnchor)       contentView.leadingAnchor.constraint(equalTo: infoHolderView.leadingAnchor)       contentView.trailingAnchor.constraint(equalTo: infoHolderView.trailingAnchor)       infoHolderView.heightAnchor.constraint(equalToConstant: 30)     }     let separatorView = UIView()     separatorView.backgroundColor = Assets.Colors.separator.color     infoHolderView.addSubview(separatorView) {       separatorView.topAnchor.constraint(equalTo: infoHolderView.topAnchor)       separatorView.leadingAnchor.constraint(equalTo: infoHolderView.leadingAnchor)       separatorView.trailingAnchor.constraint(equalTo: infoHolderView.trailingAnchor)       separatorView.heightAnchor.constraint(equalToConstant: 0.5)     }     textView = UITextView()     contentView.addSubview(textView) {       textView.topAnchor.constraint(equalTo: contentView.topAnchor)       textView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor)       textView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor)       textView.bottomAnchor.constraint(equalTo: infoHolderView.topAnchor)     }   } }
Replies
0
Boosts
0
Views
1.6k
Activity
Feb ’22