Recherche avancée

Médias (21)

Mot : - Tags -/Nine Inch Nails

Autres articles (90)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • List of compatible distributions

    26 avril 2011, par

    The table below is the list of Linux distributions compatible with the automated installation script of MediaSPIP. Distribution nameVersion nameVersion number Debian Squeeze 6.x.x Debian Weezy 7.x.x Debian Jessie 8.x.x Ubuntu The Precise Pangolin 12.04 LTS Ubuntu The Trusty Tahr 14.04
    If you want to help us improve this list, you can provide us access to a machine whose distribution is not mentioned above or send the necessary fixes to add (...)

Sur d’autres sites (12184)

  • Interfacing to an Xbox Optical Drive

    1er octobre 2013, par Multimedia Mike — xbox

    The next generation Xbox is going to hit the streets soon. But for some reason, I’m still interested in the previous generation’s unit (i.e., the original Xbox). Specifically, I’ve always wondered if it’s possible to use the original Xbox’s optical drive in order to read Xbox discs from Linux. I was never curious enough to actually buy an Xbox just to find out but I eventually came across a cast-off console on a recycle pile.

    I have long known that the Xbox has what appears to be a more or less standard optical drive with a 40-pin IDE connector. The only difference is the power adapter which I surmise is probably the easiest way to turn a bit of standardized hardware into a bit of proprietary hardware. The IDE and power connectors look like this :


    Xbox optical drive connections

    Thus, I wanted to try opening an Xbox and plugging the optical drive into a regular PC, albeit one that supports IDE cables, and allow the Xbox to supply power to the drive. Do you still have hardware laying around that has 40-pin IDE connectors ? I guess my Mac Mini PPC fits the bill, but I’ll be darned if I’m going to pry that thing open again. I have another IDE-capable machine buried in my closet, last called into service when I needed a computer with a native RS-232 port 3 years ago. The ordeal surrounding making this old computer useful right now can be another post entirely.

    Here’s what the monstrosity looks like thanks to characteristically short IDE cable lengths :


    Xbox optical drive connected directly to PC

    Click for larger image


    Process :

    1. Turn on Xbox first
    2. Turn on PC

    Doing these things in the opposite order won’t work since the kernel really wants to see the drive when booting up. Inspecting the 'dmesg' log afterward reveals interesting items :

    <br />
    hdd: PHILIPS XBOX DVD DRIVE, ATAPI CD/DVD-ROM drive<br />
    hdd: host max PIO5 wanted PIO255(auto-tune) selected PIO4<br />
    hdd: UDMA/33 mode selected<br />
    [...]<br />
    hdd: ATAPI DVD-ROM drive, 128kB Cache<br />

    Why is that interesting ? When is the last time to saw disk devices prefixed by ‘hd’ rather than ‘sd’ ? Blast from the past. Oh, and the optical drive’s vendor string clearly indicates that this is an Xbox drive saying ‘hi !’.

    Time To Read
    When I first studied an Xbox disc in a normal optical drive, I noticed that I was able to read 6992 2048-byte sectors — about 14 MB of data — as reported by the disc table of contents (TOC). This is just enough data to play a standard DVD video animation that kindly instructs the viewer to please use a proper Xbox. At this point, I estimated that there must be something special about Xbox optical drive firmware that knows how to read alternate information on these discs and access further sectors.

    I ran my TOC query tool with an Xbox Magazine demo disc in the optical drive and it reported substantially more than 6992 sectors, enough to account for more than 2 GB of data. That’s promising. I then tried running 'dd' against the device and it was able to read… about 14 MB, an exact quantity of bytes that, when divided by 2048 bytes/sector, yields 6992 sectors.

    Future (Past ?) Work
    Assuming Google is your primary window into the broader internet, the world is beginning to lose its memory of things pertaining to the original Xbox (Microsoft’s naming scheme certainly doesn’t help searches). What I’m saying is that it can be difficult to find information about this stuff now. However, I was able to learn that a host needs to perform a sort of cryptographic handshake with the drive at the SCSI level before it is allowed to access the forbidden areas of the disc. I think. I’m still investigating this and will hopefully post more soon.

  • FFMPEG : TS video copied to MP4, missing 3 first frames [closed]

    21 août 2023, par Vasilis Lemonidis

    Running :

    &#xA;

    ffmpeg -i test.ts -fflags &#x2B;genpts -c copy -y test.mp4&#xA;

    &#xA;

    for this test.ts, which has 30 frames, readable by opencv, I end up with 28 frames, out of which 27 are readable by opencv. More specifically :

    &#xA;

    ffprobe -v error -select_streams v:0 -count_packets  -show_entries stream=nb_read_packets -of csv=p=0 tmp.ts &#xA;

    &#xA;

    returns 30.

    &#xA;

    ffprobe -v error -select_streams v:0 -count_packets     -show_entries stream=nb_read_packets -of csv=p=0 tmp.mp4&#xA;

    &#xA;

    returns 28.

    &#xA;

    Using OpenCV in that manner

    &#xA;

    cap = cv2.VideoCapture(tmp_path)&#xA;readMat = []&#xA;while cap.isOpened():&#xA;        ret, frame = cap.read()&#xA;        if not ret:&#xA;            break&#xA;        readMat.append(frame)&#xA;

    &#xA;

    I get for the ts file 30 frames, while for the mp4 27 frames.

    &#xA;

    Could someone explain why the discrepancies ? I get no error during the transformation from ts to mp4 :

    &#xA;

    ffmpeg version N-111746-gd53acf452f Copyright (c) 2000-2023 the FFmpeg developers&#xA;  built with gcc 11.3.0 (GCC)&#xA;  configuration: --ld=g&#x2B;&#x2B; --bindir=/bin --extra-libs=&#x27;-lpthread -lm&#x27; --pkg-config-flags=--static --enable-static --enable-gpl --enable-libaom --enable-libass --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libsvtav1 --enable-libdav1d --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-cuda-nvcc --enable-cuvid --enable-nvenc --enable-libnpp &#xA;  libavutil      58. 16.101 / 58. 16.101&#xA;  libavcodec     60. 23.100 / 60. 23.100&#xA;  libavformat    60. 10.100 / 60. 10.100&#xA;  libavdevice    60.  2.101 / 60.  2.101&#xA;  libavfilter     9. 10.100 /  9. 10.100&#xA;  libswscale      7.  3.100 /  7.  3.100&#xA;  libswresample   4. 11.100 /  4. 11.100&#xA;  libpostproc    57.  2.100 / 57.  2.100&#xA;[mpegts @ 0x4237240] DTS discontinuity in stream 0: packet 5 with DTS 306003, packet 6 with DTS 396001&#xA;Input #0, mpegts, from &#x27;tmp.ts&#x27;:&#xA;  Duration: 00:00:21.33, start: 3.400000, bitrate: 15 kb/s&#xA;  Program 1 &#xA;    Metadata:&#xA;      service_name    : Service01&#xA;      service_provider: FFmpeg&#xA;  Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(progressive), 300x300, 1 fps, 3 tbr, 90k tbn&#xA;Output #0, mp4, to &#x27;test.mp4&#x27;:&#xA;  Metadata:&#xA;    encoder         : Lavf60.10.100&#xA;  Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 300x300, q=2-31, 1 fps, 3 tbr, 90k tbn&#xA;Stream mapping:&#xA;  Stream #0:0 -> #0:0 (copy)&#xA;Press [q] to stop, [?] for help&#xA;[out#0/mp4 @ 0x423e280] video:25kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 4.192123%&#xA;frame=   30 fps=0.0 q=-1.0 Lsize=      26kB time=00:00:21.00 bitrate=  10.3kbits/s speed=1e&#x2B;04x &#xA;

    &#xA;

    Additional information

    &#xA;

    The origin of the video I am processing comes from a continuous stitching operation of still images ts videos, produced by this class update method :

    &#xA;

    import cv2&#xA;import os&#xA;import subprocess&#xA;from tempfile import NamedTemporaryFile&#xA;class VideoUpdater:&#xA;    def __init__(&#xA;        self, video_path: str, framerate: int, timePerFrame: Optional[int] = None&#xA;    ):&#xA;        """&#xA;        Video updater takes in a video path, and updates it using a supplied frame, based on a given framerate.&#xA;        Args:&#xA;            video_path: str: Specify the path to the video file&#xA;            framerate: int: Set the frame rate of the video&#xA;        """&#xA;        if not video_path.endswith(".mp4"):&#xA;            LOGGER.warning(&#xA;                f"File type {os.path.splitext(video_path)[1]} not supported for streaming, switching to ts"&#xA;            )&#xA;            video_path = os.path.splitext(video_path)[0] &#x2B; ".mp4"&#xA;&#xA;        self._ps = None&#xA;        self.env = {&#xA;            &#xA;        }&#xA;        self.ffmpeg = "/usr/bin/ffmpeg "&#xA;&#xA;        self.video_path = video_path&#xA;        self.ts_path = video_path.replace(".mp4", ".ts")&#xA;        self.tfile = None&#xA;        self.framerate = framerate&#xA;        self._video = None&#xA;        self.last_frame = None&#xA;        self.curr_frame = None&#xA;&#xA;&#xA;    def update(self, frame: np.ndarray):&#xA;        if len(frame.shape) == 2:&#xA;            frame = cv2.cvtColor(frame, cv2.COLOR_GRAY2BGR)&#xA;        else:&#xA;            frame = cv2.cvtColor(frame, cv2.COLOR_RGB2BGR)&#xA;        self.writeFrame(frame)&#xA;&#xA;    def writeFrame(self, frame: np.ndarray):&#xA;        """&#xA;        The writeFrame function takes a frame and writes it to the video file.&#xA;        Args:&#xA;            frame: np.ndarray: Write the frame to a temporary file&#xA;        """&#xA;&#xA;&#xA;        tImLFrame = NamedTemporaryFile(suffix=".png")&#xA;        tVidLFrame = NamedTemporaryFile(suffix=".ts")&#xA;&#xA;        cv2.imwrite(tImLFrame.name, frame)&#xA;        ps = subprocess.Popen(&#xA;            self.ffmpeg&#xA;            &#x2B; rf"-loop 1 -r {self.framerate} -i {tImLFrame.name} -t {self.framerate} -vcodec libx264 -pix_fmt yuv420p -y {tVidLFrame.name}",&#xA;            env=self.env,&#xA;            shell=True,&#xA;            stdout=subprocess.PIPE,&#xA;            stderr=subprocess.PIPE,&#xA;        )&#xA;        ps.communicate()&#xA;        if os.path.isfile(self.ts_path):&#xA;            # this does not work to watch, as timestamps are not updated&#xA;            ps = subprocess.Popen(&#xA;                self.ffmpeg&#xA;                &#x2B; rf&#x27;-i "concat:{self.ts_path}|{tVidLFrame.name}" -c copy -y {self.ts_path.replace(".ts", ".bak.ts")}&#x27;,&#xA;                env=self.env,&#xA;                shell=True,&#xA;                stdout=subprocess.PIPE,&#xA;                stderr=subprocess.PIPE,&#xA;            )&#xA;            ps.communicate()&#xA;            shutil.move(self.ts_path.replace(".ts", ".bak.ts"), self.ts_path)&#xA;&#xA;        else:&#xA;            shutil.copyfile(tVidLFrame.name, self.ts_path)&#xA;        # fixing timestamps, we dont have to wait for this operation&#xA;        ps = subprocess.Popen(&#xA;            self.ffmpeg&#xA;            &#x2B; rf"-i {self.ts_path} -fflags &#x2B;genpts -c copy -y {self.video_path}",&#xA;            env=self.env,&#xA;            shell=True,&#xA;            # stdout=subprocess.PIPE,&#xA;            # stderr=subprocess.PIPE,&#xA;        )&#xA;        tImLFrame.close()&#xA;        tVidLFrame.close()&#xA;

    &#xA;

  • Weird commandline behaviour when running a batch script. Script will only work if another script is being run first [closed]

    31 décembre 2022, par Macster

    TLDR ;
    &#xA;In cmd.exe
    &#xA;makedir.bat only <= Not working
    &#xA;new.bat then makedir.bat <= Working

    &#xA;

    I'm new to batch and noticed a weird behaviour when running a scrip.

    &#xA;

    It basically takes the last entry(Video file path) from a textfile and uses the path inside a ffmpeg command to get the file duration. But it's not working. makedir.bat

    &#xA;

    What I know is that the part which gets the path is working on it's own, and so does the part that gets the duration.

    &#xA;

    Now, if I run a second script, new.bat, which is actually just the part that gets the files duration and outputs the right duration(22 Seconds), before running makedir.bat, suddenly makedir.bat starts working as intended, even though set /a duration=2*3600*60&#x2B;*1 in the output is wrong. But thats only for cmd.exe. It wont work for PowerShell.&#xA;Whats going on ? Is the script faulty or is there some kind of caching in the cmd.exe ?

    &#xA;

    EDIT : Oh, and if I run makedir.bat first and then new.bat, new.bat wont work anymore.

    &#xA;

    makedir.bat

    &#xA;

    ::Get last entry from "mylist.txt"&#xA;for /f "delims=" %%a in (&#x27;type mylist.txt ^| findstr /b /c:"file"&#x27;) do set path=%%a&#xA;&#xA;::Trim path for file name&#xA;set video_path=%path:~32,-1%&#xA;&#xA;echo %video_path%&#xA;&#xA;::Get the video duration&#xA;for /f "tokens=1* delims=:" %%a in (&#x27;ffmpeg -i %video_path% 2^>^&amp;1 ^| findstr "Duration"&#x27;) do set duration=%%b&#xA;&#xA;set duration=%duration:~0,12%&#xA;set /a duration=%duration:~1,2%*3600&#x2B;%duration:~4,2%*60&#x2B;%duration:~7,2%*1&#xA;echo %duration%&#xA;

    &#xA;

    new.bat

    &#xA;

    for /F "tokens=1* delims=:" %%a in (&#x27;ffmpeg -i pipshort1.webm 2^>^&amp;1 ^| findstr "Duration"&#x27;) do set duration=%%b&#xA;set duration=%duration:~0,12%&#xA;set /a duration=%duration:~1,2%*3600&#x2B;%duration:~4,2%*60&#x2B;%duration:~7,2%*1&#xA;

    &#xA;

    Ouput makedir.bat

    &#xA;

    >for /F "delims=" %a in (&#x27;type mylist.txt | findstr /b /c:"file"&#x27;) do set path=%a&#xA;&#xA;>set path=file &#x27;/webapp/stream/videos/pip/transparent_short.webm&#x27;&#xA;&#xA;>set path=file &#x27;/webapp/stream/videos/pip/transparent_short.webm&#x27;&#xA;&#xA;>set path=file &#x27;/webapp/stream/videos/pip/transparent_short.webm&#x27;&#xA;&#xA;>set path=file &#x27;/webapp/stream/videos/pip/pipshort1.webm&#x27;&#xA;&#xA;>set video_path=pipshort1.webm&#xA;&#xA;>echo pipshort1.webm&#xA;pipshort1.webm&#xA;&#xA;>for /F "tokens=1* delims=:" %a in (&#x27;ffmpeg -i pipshort1.webm 2>&amp;1 | findstr "Duration"&#x27;) do set duration=%b&#xA;&#xA;>set duration=~0,12&#xA;&#xA;>set /a duration=0,*3600&#x2B;2*60&#x2B;*1&#xA;Missing operator&#xA;&#xA;>echo 0&#xA;0&#xA;

    &#xA;

    Output new.bat + makedir.bat

    &#xA;

    >new.bat&#xA;&#xA;>for /F "tokens=1* delims=:" %a in (&#x27;ffmpeg -i pipshort1.webm 2>&amp;1 | findstr "Duration"&#x27;) do set duration=%b&#xA;&#xA;>set duration= 00:00:22.02, start: 0.000000, bitrate: 2337 kb/s&#xA;&#xA;>set duration= 00:00:22.02&#xA;&#xA;>set /a duration=00*3600&#x2B;00*60&#x2B;22*1&#xA;&#xA;>echo 22&#xA;22&#xA;&#xA;>makedir.bat&#xA;&#xA;>for /F "delims=" %a in (&#x27;type mylist.txt | findstr /b /c:"file"&#x27;) do set path=%a&#xA;&#xA;>set path=file &#x27;/webapp/stream/videos/pip/transparent_short.webm&#x27;&#xA;&#xA;>set path=file &#x27;/webapp/stream/videos/pip/transparent_short.webm&#x27;&#xA;&#xA;>set path=file &#x27;/webapp/stream/videos/pip/transparent_short.webm&#x27;&#xA;&#xA;>set path=file &#x27;/webapp/stream/videos/pip/pipshort1.webm&#x27;&#xA;&#xA;>set video_path=pipshort1.webm&#xA;&#xA;>echo pipshort1.webm&#xA;pipshort1.webm&#xA;&#xA;>for /F "tokens=1* delims=:" %a in (&#x27;ffmpeg -i pipshort1.webm 2>&amp;1 | findstr "Duration"&#x27;) do set duration=%b&#xA;&#xA;>set duration=22&#xA;&#xA;>set /a duration=2*3600&#x2B;*60&#x2B;*1&#xA;Missing operator&#xA;&#xA;>echo 22&#xA;22&#xA;

    &#xA;