{"id":15646200,"url":"https://github.com/fosterseth/sdl2_video_player","last_synced_at":"2025-04-30T11:55:45.389Z","repository":{"id":61228263,"uuid":"91297474","full_name":"fosterseth/sdl2_video_player","owner":"fosterseth","description":"video player built with ffmpeg and SDL2","archived":false,"fork":false,"pushed_at":"2017-12-06T04:29:56.000Z","size":19476,"stargazers_count":67,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-30T15:51:15.776Z","etag":null,"topics":["audio-video","audiovideo","ffmpeg","libav","msys2","multiple","sdl","sdl2","sdl2-video-player","server","simultaneous","socket-programming","tcp","tcp-commands","video","video-player"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fosterseth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-15T05:12:02.000Z","updated_at":"2024-12-25T14:49:34.000Z","dependencies_parsed_at":"2022-10-13T06:13:06.794Z","dependency_job_id":null,"html_url":"https://github.com/fosterseth/sdl2_video_player","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosterseth%2Fsdl2_video_player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosterseth%2Fsdl2_video_player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosterseth%2Fsdl2_video_player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fosterseth%2Fsdl2_video_player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fosterseth","download_url":"https://codeload.github.com/fosterseth/sdl2_video_player/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251694473,"owners_count":21628854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audio-video","audiovideo","ffmpeg","libav","msys2","multiple","sdl","sdl2","sdl2-video-player","server","simultaneous","socket-programming","tcp","tcp-commands","video","video-player"],"created_at":"2024-10-03T12:11:47.573Z","updated_at":"2025-04-30T11:55:45.346Z","avatar_url":"https://github.com/fosterseth.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sdl2 video player\r\n\r\n## Overview\r\nA lightweight video player built on the SDL2 and ffmpeg libraries. It can play multiple videos simultaneously, all synced to a master clock.\r\nIn addition, the video playback can be controlled via TCP commands, e.g. \"open movie.mp4\", \"play\", \"pause\", \"seekto 350.0\", etc.\r\nThis allows for an easy interface to other applications - Python, Javascript, etc. -- anything that handles basic network sockets.\r\n\r\n## Requirements to Compile\r\nOriginally built with msys2 and the mingw64 gcc compiler on a Windows 10 machine.\r\n\r\nmsys2 packages:\r\n- mingw-w64-x86_64-ffmpeg 3.3-1\r\n- mingw-w64-x86_64-SDL2 2.0.5-1\r\n\r\nHere are my compiler options in CodeLite\r\n- preprocessor : main=SDL_main\r\n- libraries : mingw32;SDL2main;SDL2;avutil;swresample;avcodec;avformat;swscale;ws2_32\r\n\r\n## Cross-platform note\r\nEverything is crossplatform except the socket programming code, read_from_client() method. The current source code has a winsock2 implementation, for Windows. It would be pretty easy to swap this out with linux socket programming.\r\n\r\n## Basic Usage\r\n#### vidserv.exe portnum movie1.mp4 movie2.mp4 ...\r\n\r\nIf you don't specify a port number, it defaults with 50001, which should be open on most machines.\r\n\r\nffmpeg supports a wide range of codecs and formats, so most videos should load fine.\r\n\r\n| Hotkey | Command |\r\n| ---    | --- |\r\n| Down | Seek 10 seconds forward |\r\n| Up | Seek 10 seconds backward |\r\n| Right | Show next frame |\r\n| Left | Seek 0.25 seconds backward |\r\n| Space | Toggle play/pause |\r\n\r\n## TCP Control\r\n\r\nVideos can be opened and controlled via tcp commands.\r\n\r\nFor example in Python, after setting up tcp connection to vidserv.exe,\r\n```python\r\nsock.send(\"seekto 60.0\".encode())\r\n```\r\n\r\n- `open movie1.mp4 xscreen yscreen width height windowname`\r\n    - e.g. open c:/users/fosterseth/desktop/movie.mp4 100 100 640 480 movie1\r\n    - To use native width and height of video, just put 0 for both width and height\r\n    \r\n- `seekto x`\r\n    - x is in seconds\r\n \r\n- `seek+`\r\n    - seeks 60 seconds forward\r\n    \r\n- `seek-`\r\n    - seeks 60 seconds back\r\n    \r\n- `seek+small`\r\n    - seeks to next frame\r\n \r\n- `seek-small`\r\n    - seeks back 0.25 seconds\r\n    \r\n- `play`\r\n\r\n- `pause`\r\n\r\n- `toggleplay`\r\n    \r\n- `gettime`\r\n    - a request for the current playback time, in seconds\r\n    - client must call recv() to get the message back\r\n\r\n- `getnumvideos`\r\n    - a request for the number of active videos\r\n    - client must call recv() to get message back\r\n    \r\n- `getpos movie1.mp4`\r\n    - a request for the current x,y,w,h of movie1.mp4\r\n    - client must call recv() to get message back\r\n    \r\n- `raisewindows`\r\n    - restores minimized windows\r\n    \r\n- `closewindows`\r\n    - closes all windows, but keeps server running\r\n    \r\n- `break`\r\n    - closes all windows and quits the server\r\n \r\n \r\n## Binaries\r\nFor convenience, the bin/ folder contains a compiled vidserv and the required DLL to run on a Windows machine.\r\n\r\n## Credits\r\ndranger's tutorial was immensely helpful for this project. Check out [his tutorial](http://dranger.com/ffmpeg/ffmpeg.html) if you are new to AV processing.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffosterseth%2Fsdl2_video_player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffosterseth%2Fsdl2_video_player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffosterseth%2Fsdl2_video_player/lists"}