I have a DCR (file has a .dcr extension) video file coming from a video surveillance device ( I don't know the make and model of the recorder )
I'm unable to read it with VLC, Media Player, and it won't open in Virtual Dub or can't be converted with the standard "ffmpeg.exe video.dcr output.avi" command line.
But I'm able to get a very basic** playback of the video stream with MPC-HC player of the Combined Community Codec Pack. Unfortunately, the audio stream (which I'm looking for) will not play.
According to the MPC-HC player file info, I'm dealing with this:
General
Format : MPEG-4 Visual
File size : 459 MiB
Video
Format : MPEG-4 Visual
Format profile : Advanced Simple#L5
Format settings, BVOP : Yes
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Muxing mode : Packed bitstream
Width : 640 pixels
Height : 480 pixels
Display aspect ratio : 4:3
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Writing library : XviD 64
** By very basic, I mean I can play the video, but not seek through it, and there is no keyframe at all in the video output.
Hopefully some of you guys will have dealt with DCR files from video surveillance equipment.
I would recommend downloading the latest version of the digital court player from http://www.bisdigital.com. This is the program that many courts use to view video from court hearings in .dcr format. You should be able to pause, rewind, fast forward, as well as control the speed of the video playback.
Related
I have several tiff image files which I need to convert to pdf files.
Some of the files get converted successfully and I'm able to get the expected output while some of the files are having the above error while I try to convert them and I get the output file as a complete black image.
I'm trying to do the above task using Imagemagick.
I tried to find more about this problem on the internet. What I understood is that the problem is with the T6Options tag of the tiff file, which is (none) in my case. I'm not able to convert this file to any compression, I tried tiffcp, exiftool, tifftopdf but nothing works
Below is the information regarding the file, which I got using exiftool:
ExifTool Version Number : 11.01
File Name : 1000006_1_1007.tif
Directory : .
File Size : 105 kB
File Modification Date/Time : 2019:07:16 14:43:09+00:00
File Access Date/Time : 2019:07:16 14:43:20+00:00
File Inode Change Date/Time : 2019:07:16 14:43:09+00:00
File Permissions : rw-rw-r--
File Type : TIFF
File Type Extension : tif
MIME Type : image/tiff
Exif Byte Order : Little-endian (Intel, II)
Image Width : 1700
Image Height : 2200
Bits Per Sample : 1
Compression : T4/Group 3 Fax
Photometric Interpretation : WhiteIsZero
Orientation : Horizontal (normal)
Samples Per Pixel : 1
Rows Per Strip : 32
X Resolution : 200
Y Resolution : 200
Planar Configuration : Chunky
Resolution Unit : inches
Subfile Type : Single page of multi-page image
Fill Order : Normal
Strip Offsets : (Binary data 449 bytes, use -b option to
extract)
Strip Byte Counts : (Binary data 249 bytes, use -b option to extract)
T4 Options : Fill bits added
T6 Options : (none)
Page Number : 1 0
Image Size : 1700x2200
Megapixels : 3.7
I was able to convert these files using "tifffile" python library
I have been working with dicom files that are about 4 MB each but I recently received some which are 280 KB each. I am not sure whether this is because they are from different CT scanners or if the new dicoms were compressed before being given to me.
Is there a way to find out and if they are compressed is there a way to uncompressed them to the original size?
This is in continuation to the other answer from #kritzel_sw.
If you see any of the following UIDs in (0002,0010) Transfer Syntax UID element:
1.2.840.10008.1.2 Implicit VR Endian: Default Transfer Syntax for DICOM
1.2.840.10008.1.2.1 Explicit VR Little Endian
1.2.840.10008.1.2.2 Explicit VR Big Endian
then the Pixel Data (7FE0,0010) Pixel Data is uncompressed. You will generally observe bigger file size here.
Not a part of your question, but objects other than image (PDF may be in case of Structured Report) can be encapsulated with following Transfer Syntax:
1.2.840.10008.1.2.1.99 Deflated Explicit VR Little Endian
Other well known values for Transfer Syntax mean that the Pixel Data is compressed.
Note that there are also private Transfer Syntax values possible for data set. Implementation of those values is generally private to the respective manufacturer.
Yes and yes.
I recommend the binary tools from the OFFIS DICOM toolkit, but you will be able to achieve the same results with different toolkits. You can find the dcmtk here.
How to find out if your files are compressed:
dcmdump <filename>
Have a look at the metaheader, the attribute Transfer Syntax UID (0002,0010) in particular. Dcmdump "translates" the unique identifier to the human readable transfer syntax, e.g.
(0002,0010) UI =LittleEndianExplicit # 20, 1 TransferSyntaxUID
The Transfer Syntax tells you whether or not the pixel data in this DICOM file is compressed.
How to decompress compressed images:
dcmdjpeg <compressed DICOM file in> <uncompressed DICOM file out>
I am using latest mediainfo. mediainfo --version shows
MediaInfoLib - v17.12
When using special character in filename, it shows valid output.
>mediainfo 'mini & bar.mp4'
Complete name : mini & bar.mp4
Format : MPEG-4
Format profile : Base Media / Version 2
Codec ID : mp42 (mp41/mp42/isom)
File size : 380 KiB
Duration : 4 s 4 ms
Overall bit rate mode : Variable
Overall bit rate : 777 kb/s
Movie name : mini
Encoded date : UTC 2015-02-21 06:02:24
Tagged date : UTC 2015-02-21 06:02:26
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High#L3.1
Format settings : CABAC / 2 Ref Frames
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 4 s 4 ms
Bit rate mode : Variable
Bit rate : 768 kb/s
Width : 854 pixels
Height : 480 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Original frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.063
Stream size : 378 KiB (99%)
Title : Core Media Video
Encoded date : UTC 2015-02-21 06:02:24
Tagged date : UTC 2015-02-21 06:02:26
Color range : Limited
Color primaries : BT.601 NTSC
Transfer characteristics : BT.709
Matrix coefficients : BT.601
Although if I use filename(valid s3 key) with special characters, from AWS S3, it is not accepting it as valid input.
I used below url where username, secret and bucketname are specific to my aws account. and 'testing/mini & bar.mp4' is the key.
https://username:secret#s3-ap-southeast-2.amazonaws.com/bucketname/testing/mini & bar.mp4
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>testing/mini</Key><RequestId>157877D3B661D9A6</RequestId></Error>
If use it with single or double quotes, it shows signature mismatch error.
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
When looked into MediaArea/MediaInfoLib code, it seems only space is handled and other special characters are not handled for aws key.
From Reader_libcurl.cpp
// URL encoding
MediaInfo_Config::urlencode ShouldUrlEncode=Config.URLEncode_Get();
if (ShouldUrlEncode==MediaInfo_Config::URLEncode_Guess)
{
if (File_URL.Path.find(' '))
ShouldUrlEncode=MediaInfo_Config::URLEncode_Yes;
}
if (ShouldUrlEncode==MediaInfo_Config::URLEncode_Yes)
File_URL.Path=ZenLib::Format::Http::URL_Encoded_Encode(File_URL.Path);
When searched further for such issues, below issue talks about space in aws key, which seems to be resolved now.
https://sourceforge.net/p/mediainfo/bugs/960/
So my questions are :
why mediainfo is not handling special characters in AWS keys?
Based on code, --urlencode options sets url encoding. How to use this option, is this option force url encoding and aws keys with special characters will be accepted?
Is there any workaround to get result of mediainfo on s3 url having special characters?
how to fix this?
I have found workaround for my problem, which is to use pre-signed url.
Following are the commands I have used:
1. aws s3 presign 's3://bucketname/testing/mini & bar™©.mp4'
output is => "presignd url"
2. mediainfo 'presignd url'
Hope it helps!!
I downloaded the 3GPP AMR-WB codec (26.173) from http://www.3gpp.org/DynaReport/26173.htm and successfully compiled it. However, the file format generated from the decoder is some so-called binary synthesized speech file (*.out). I am wondering what is the exact format and how I can play the the file? Thanks
For AMR-WB, output will be raw PCM with following properties
16000 (16Khz) sampling frequency
1 (mono) channel
16 bits per channel
You can play it using Audacity or any other player which supports PCM input.
I’m creating a code to delete some video files that I don’t need. The videos are from CCTV footage and they record 24/7. However the software that records the video saves the files in ~1 hour videos and this is the problem (not being exact duration). I’m only interested in keeping videos from a particular part of the day (which varies) and because the duration of the video is not exact this is causing me problems.
The video file name has a date and time stamp but only for the start so if I could find the duration everything becomes simple algebra.
So my question is simple is it possible to get the duration (time) of video files using R?
Just a couple of other useful information the videos are from several cameras and each camera as a different recording frame rate so using file.info to return the file size and derive the length of the video is not an option. Also the video files are in .avi format.
Cheers
Patrao
As far as I know, there are no ready packages that handle video files in R (like matlab does). This isn't a pure R solution, but gets the job done. I installed CLI interface to MediaInfo and called it from R. I called it using system.
wolf <- system("q:/mi_cli/mediainfo.exe Krofel_video2volk2.AVI", intern = TRUE)
wolf # output by MediaInfo
[1] "General"
[2] "Complete name : Krofel_video2volk2.AVI"
[3] "Format : AVI"
[4] "Format/Info : Audio Video Interleave"
[5] "File size : 10.7 MiB"
[6] "Duration : 11s 188ms"
[7] "Overall bit rate : 8 016 Kbps"
...
[37] "Channel count : 1 channel"
[38] "Sampling rate : 8 000 Hz"
[39] "Bit depth : 16 bits"
[40] "Stream size : 174 KiB (2%)"
[41] "Alignment : Aligned on interleaves"
[42] "Interleave, duration : 63 ms (1.00 video frame)"
# Find where Duration is (general) and extract it.
find.duration <- grepl("Duration", wolf)
wolf[find.duration][1]# 1 = General, 2 = Video, 3 = Audio
[1] "Duration : 11s 188ms"
Have fun parsing the time.
This might be a bit low level, but if you're up to the task of parsing binary data, look up a copy of the AVI spec and figure out how to get both the number of video frames and the frame rate.
If you look at one of the AVI files using a hex editor, you will see a series of LIST chunks at the beginning. A little farther into this chunk will be a vids chunk. Immediately following vids should be a human-readable video four-character code (FourCC) specifying the video codec, probably something like mjpg (MJPEG) or avc1 (H.264) for a camera. 20 bytes after that will be 4 bytes stored in little endian notation which indicate the frame rate. Skip another 4 bytes and then the next 4 bytes will be another little endian number which indicate the total number of video frames.
I'm looking at a sample AVI file right now where the numbers are: frame rate = 24 and # of frames = 0x37EB = 14315. This works out to 9m56s, which is accurate for this file.