Skip to content

Instantly share code, notes, and snippets.

@lukapaunovic lukapaunovic/FIX.php
Last active Oct 11, 2018

Embed
What would you like to do?
PHP Fatal error: Uncaught Error: Call to a member function get() on null in /home/user/public_html/app/lib/OneFileManager/Console.php:840
// I changed this
if ($ffprobe->streams($file)->videos()->first()->get("codec_name") != "h264" || $ffprobe->streams($file)->audios()->first()->get("codec_name") != "aac") {
// Vide is not MP4, should be converted
$save = true;
}
// To this
if ($ffprobe->streams($file)->videos()->first()->get("codec_name") != "h264") {
// Vide is not MP4, should be converted
$save = true;
}
// Error gone, script works
Cause: when video doesn't have audio information
Example:
{
"streams": [
{
"index": 0,
"codec_name": "h264",
"codec_long_name": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10",
"profile": "Main",
"codec_type": "video",
"codec_time_base": "1/60",
"codec_tag_string": "avc1",
"codec_tag": "0x31637661",
"width": 640,
"height": 1136,
"has_b_frames": 2,
"sample_aspect_ratio": "639:640",
"display_aspect_ratio": "9:16",
"pix_fmt": "yuv420p",
"level": 30,
"chroma_location": "left",
"refs": 4,
"is_avc": "1",
"nal_length_size": "4",
"r_frame_rate": "30/1",
"avg_frame_rate": "30/1",
"time_base": "1/15360",
"start_pts": 0,
"start_time": "0.000000",
"duration_ts": 87552,
"duration": "5.700000",
"bit_rate": "3054614",
"bits_per_raw_sample": "8",
"nb_frames": "171",
"disposition": {
"default": 1,
"dub": 0,
"original": 0,
"comment": 0,
"lyrics": 0,
"karaoke": 0,
"forced": 0,
"hearing_impaired": 0,
"visual_impaired": 0,
"clean_effects": 0,
"attached_pic": 0
},
"tags": {
"language": "und",
"handler_name": "VideoHandler"
}
}
],
"format": {
"filename": "https://scontent-lga3-1.cdninstagram.com/vp/a4173b1bc89da6b8ecefcfdae5eeb23f/5B3A8C6E/t50.12441-16/36017339_608589996170453_5336505296802221045_n.mp4",
"nb_streams": 1,
"nb_programs": 0,
"format_name": "mov,mp4,m4a,3gp,3g2,mj2",
"format_long_name": "QuickTime / MOV",
"start_time": "0.000000",
"duration": "5.700000",
"size": "2179314",
"bit_rate": "3058686",
"probe_score": 100,
"tags": {
"major_brand": "isom",
"minor_version": "512",
"compatible_brands": "isomiso2avc1mp41",
"encoder": "Lavf56.40.101"
}
}
}
@sergeykomlev

This comment has been minimized.

Copy link

sergeykomlev commented Oct 11, 2018

@lukapaunovic, Thanks! Help me solved this error for uploading video without sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.