How do I exclude basic information from exiftool output? - jpeg

I have a JPEG that I think has no EXIF data and I want to see if it is possible to detect scrubbing.
When I run exiftool on it I get the output below.
Are these fields derived by exiftool, even if there are no EXIF data, or does the output necessarily indicate the presence of EXIF inside the JPEG?
Or do all JPEGs contain EXIF even if they were to be scrubbed?
Is there a way to disable output of the derived information below to enable scrubbing detection?
ExifTool Version Number : 10.80
File Name : dummy.jpg
Directory : /home/me
File Size : 452 kB
File Modification Date/Time : 2021:02:02 14:41:53+02:00
File Access Date/Time : 2021:02:02 14:42:52+02:00
File Inode Change Date/Time : 2021:02:02 14:41:58+02:00
File Permissions : rw-r--r--
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
JFIF Version : 1.02
Resolution Unit : None
X Resolution : 1
Y Resolution : 1
Image Width : 2480
Image Height : 3507
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:2:0 (2 2)
Image Size : 2480x3507
Megapixels : 8.7

The command you want to run is this
exiftool -G0 -a -s dummy.jpg
This command will show tags with duplicate names (-a (-duplicates) option) and the groups they belong to (-G (-groupNames) option). Also, the -s (short) option will give you tag names, not tag descriptions (see exiftool FAQ #2).
The resulting output would look similar to this
[ExifTool] ExifToolVersion : 12.16
[File] FileName : Test4.jpg
[File] Directory : y:/!temp
[File] FileSize : 435 KiB
[File] FileModifyDate : 2021:01:26 08:22:03-08:00
[File] FileAccessDate : 2021:01:26 08:22:03-08:00
[File] FileCreateDate : 2021:01:05 15:39:42-08:00
[File] FilePermissions : rw-rw-rw-
[File] FileType : JPEG
[File] FileTypeExtension : jpg
[File] MIMEType : image/jpeg
[File] ImageWidth : 1749
[File] ImageHeight : 1205
[File] EncodingProcess : Baseline DCT, Huffman coding
[File] BitsPerSample : 8
[File] ColorComponents : 3
[File] YCbCrSubSampling : YCbCr4:2:0 (2 2)
[JFIF] JFIFVersion : 1.02
[JFIF] ResolutionUnit : inches
[JFIF] XResolution : 1
[JFIF] YResolution : 1
[Composite] ImageSize : 1749x1205
[Composite] Megapixels : 2.1
The [ExifTool] group is obviously the version of exiftool used to list the data. Anything in the [File] group is a property of the file. This can include file system tags like the create date (FileCreateDate) or permissions (FilePermissions), properties of image, such as the width/height or image type, such as jpeg/tiff/png, as well as other non-editable details. Items in the [Composite] group are tags exiftool creates based upon other tags in the file. These are often created in a more human readable format or for ease of copying to other tags and/or files.
The only embedded data in your file is the [JFIF] header, which contains no personally identifiable data.
You can suppress output of the Composite group by adding the -e (--composite) option. Other groups can be suppressed by adding --GROUP:All to the command, i.e. adding --File:all would suppress all tags in the File group.

Related

plupload, preserve_headers = false, and autorotation issue

I have a jpeg image where the EXIF Orientation flag = 6, or "Rotate 90 CW". Here's the pertinent data from exiftool:
---- ExifTool ----
ExifTool Version Number : 12.44
---- File ----
File Name : orig.jpg
Image Width : 4032
Image Height : 3024
---- EXIF ----
Orientation : Rotate 90 CW
Exif Image Width : 4032
Exif Image Height : 3024
---- Composite ----
Image Size : 4032x3024
Here's how IrfanView presents the image, with auto-rotate turned off:
Using the plupload "Getting Started" script from here, with preserve_headers = false, I get an image without EXIF headers - as expected - but rotated 180 degrees, which is unexpected. Again, the view with IrfanView:
Here's the "resize" snippet from the code:
resize: {
width: 5000,
height: 5000,
preserve_headers: false
}
Is there something I'm doing wrong? I would have expected a 90 CW rotation on upload with the EXIF stripped.
Dan
Edit: I'm using plupload V2.3.9
BUMP
I'm getting the exact same result with plupload using these exif samples on github. I chose landscape_6, because it's Orientation is the same as my example ("Rotate 90 CW", or Orientation tag value 6). Here's the before and after upload views using IrfanView with no autorotate, preserve_headers = false:
Aren't these canonical examples for demonstrating exif properties? Unless I'm missing some fundamental point, plupload is busted. I'd much rather it be the former, and someone can tell me the error of my ways.

Convert .mp4 to .mpeg4 using Converter

I have an MP4 file, which I would like to convert into an MPEG4 file. TO do this, I have found the PythonVideoConvert package. On the PyPI page, the following code is given:
from converter import Converter
conv = Converter()
info = conv.probe('test/test1.avi')
PATH = 'C:/Users/.../'
convert = conv.convert(PATH +'Demo.mp4', PATH + 'Demo.mpeg4', {
'format': 'mpeg4',
'audio': {
'codec': 'aac',
'samplerate': 11025,
'channels': 2
},
'video': {
'codec': 'hevc',
'width': 720,
'height': 400,
'fps': 25
}})
When I run this code, a convert object is created. However, there is no .mpeg4 video in the PATH directory.
Therefore, I have two questions:
Is the code above correct for converting a .mp4 file into a .mpeg4 file
What do I need to run to save the converted video as a .mpeg4 file?
Based on Selcuk's comment, I ran the following code:
for timecode in convert:
pass
This gives the error:
Traceback (most recent call last):
File "<ipython-input-60-14c9225c3ac2>", line 1, in <module>
for timecode in convert:
File "C:\Users\20200016\Anaconda3\lib\site-packages\converter\__init__.py", line 229, in convert
optlist = self.parse_options(options, twopass)
File "C:\Users\20200016\Anaconda3\lib\site-packages\converter\__init__.py", line 60, in parse_options
raise ConverterError(f'Requested unknown format: {str(f)}')
ConverterError: Requested unknown format: mpeg4
So, my suggested format seems incorrect. What can I do to convert a video into .mpeg4?
I don't think PythonVideoConverter is meant to be used in Windows.
I was getting an exception AttributeError: module 'signal' has no attribute 'SIGVTALRM', because SIGVTALRM is not a valid signal in Windows.
The default path of FFmpeg an FFprobe command line tools, also doesn't make sense for Windows.
We may still use the package in Windows, but it's recommended to set ffmpeg_path and ffprobe_path.
Example:
conv = Converter(ffmpeg_path=r'c:\FFmpeg\bin\ffmpeg.exe', ffprobe_path=r'c:\FFmpeg\bin\ffprobe.exe')
We also have to disable the timeout feature, by setting timeout=None argument.
mpeg4 is not a valid FFmpeg format, but we can still use it as a file extension.
(format is FFmpeg terminology usually applies container format).
When non-standart file extension is used, we have to set the format entry.
Setting 'format': 'mp4' creates MP4 file container (may be created with the non-standart .mpeg4 file extension).
Complete code sample:
from converter import Converter
conv = Converter(ffmpeg_path=r'c:\FFmpeg\bin\ffmpeg.exe', ffprobe_path=r'c:\FFmpeg\bin\ffprobe.exe')
#info = conv.probe('test/test1.avi')
PATH = 'C:/Users/Rotem/'
convert = conv.convert(PATH + 'Demo.mp4', PATH + 'Demo.mpeg4', {
'format': 'mp4', #'format': 'mpeg4',
'audio': {
'codec': 'aac',
'samplerate': 11025,
'channels': 2
},
'video': {
'codec': 'hevc',
'width': 720,
'height': 400,
'fps': 25
}},
timeout=None)
# https://pypi.org/project/PythonVideoConverter/
for timecode in convert:
print(f'\rConverting ({timecode:.2f}) ...')
We may see the media information of Demo.mpeg4 using MediaInfo tool:
General
Complete name : C:\Users\Rotem\Demo.mpeg4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom (isom/iso2/mp41)
File size : 207 KiB
Duration : 10 s 148 ms
Overall bit rate mode : Variable
Overall bit rate : 167 kb/s
Writing application : Lavf58.45.100
FileExtension_Invalid : braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v
Video
ID : 1
Format : HEVC
Format/Info : High Efficiency Video Coding
Format profile : Main#L3#Main
Codec ID : hev1
Codec ID/Info : High Efficiency Video Coding
Duration : 10 s 0 ms
Bit rate : 82.5 kb/s
Width : 720 pixels
Height : 400 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.011
Stream size : 101 KiB (49%)
Writing library : x265 3.4+28-419182243:[Windows][GCC 9.3.0][64 bit] 8bit+10bit+12bit
Encoding settings : ...
Color range : Limited
Codec configuration box : hvcC
Audio
ID : 2
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Codec ID : mp4a-40-2
Duration : 10 s 148 ms
Duration_LastFrame : -70 ms
Bit rate mode : Variable
Bit rate : 79.1 kb/s
Maximum bit rate : 128 kb/s
Channel(s) : 2 channels
Channel layout : L R
Sampling rate : 11.025 kHz
Frame rate : 10.767 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 98.0 KiB (47%)
Title : IsoMedia File Produced by Google, 5-11-2011
Language : English
Default : Yes
Alternate group : 1
In MediaInfo output, the MP4 file container applies "MPEG-4" format...
Note:
The HEVC video format applies H.265 video codec - in most cases the codec is considered to be more relevant then container.
'Requested unknown format: mpeg4'
*.mpeg4 is not valid container. mpeg4 is codec, *.something (avi, mp4, mov, mkv, ...) are containers.
basicly: codec.CONTAINER or your_mpeg4_video.mkv etc.
video codec (like mpeg4) handle only video, but you need more than only visual, you need audio, many audio tracks (eng, de, nl, 2.0, 5.1, 7.1 ...), subtitles, etc and these stuff are inside container.
install ffmpeg: https://ffmpeg.org/
try this basic script:
import subprocess
input_file = 'Demo.mp4'
output_file = 'Demo.mkv' # or .mp4, .mov, ...
ffmpeg_cli = "ffmpeg -i '{}' -vcodec libx265 '{}'".format(input_file, output_file)
subprocess.call(ffmpeg_cli, shell=True)
I don't know what are you doing (what you want, what are your expectations) but if you looking for way how to degrese size of video,
look here: https://github.com/MarcelSuleiman/convert_h264_to_h265
simple.

3GP video with "jpeg" video codec

I have cheap feature phone which can record videos in 3gp file format. When I upload such video to computer and inspect it with mediainfo it gives mysteriuos output:
Format : MPEG-4
Format profile : 3GPP Media Release 5
Codec ID : 3gp5 (3gp5)
File size : 4.69 MiB
Duration : 1 min 7 s
Overall bit rate : 585 kb/s
Encoded date : UTC 1970-01-01 00:02:13
Tagged date : UTC 1970-01-01 00:02:13
Video
ID : 2
Format : JPEG
Codec ID : jpeg
Duration : 1 min 7 s
Source duration : 1 min 7 s
Bit rate : 571 kb/s
Width : 240 pixels
Height : 320 pixels
Display aspect ratio : 0.750
Frame rate mode : Variable
Frame rate : 9.137 FPS
Minimum frame rate : 3.686 FPS
Maximum frame rate : 17.192 FPS
Color space : YUV
Chroma subsampling : 4:2:2
Bit depth : 8 bits
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.813
Stream size : 4.57 MiB (97%)
Source stream size : 4.57 MiB (97%)
Language : English
Encoded date : UTC 1970-01-01 00:02:13
Tagged date : UTC 1970-01-01 00:02:13
mdhd_Duration : 67133
The video codec is "JPEG".
When I play video in Totem Video Player, codec name is "JPEG still images".
I tested that my phone doesn't support MJPEG and mediainfo shows that codec is (also) identified as MPEG-4. When I opened video in hex editor it appeared as sequences of JPEG images, which shouldn't be possible (3gp container supports H.263 and MPEG-4 not MJPEG). On the other hand sample video converted to 3gp MPEG-4 gives this mediainfo output:
Format profile : 3GPP Media Release 4
Codec ID : 3gp4 (isom/iso2/3gp4)
File size : 1.84 MiB
Duration : 16 s 50 ms
Overall bit rate mode : Variable
Overall bit rate : 960 kb/s
Video
ID : 1
Format : MPEG-4 Visual
Format profile : Simple#L3
Format settings, BVOP : No
Format settings, QPel : No
Format settings, GMC : No warppoints
Format settings, Matrix : Default (H.263)
Codec ID : mp4v-20
Duration : 16 s 50 ms
Bit rate mode : Variable
Bit rate : 659 kb/s
Maximum bit rate : 1 000 kb/s
Width : 240 pixels
Height : 180 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 20.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.763
Stream size : 1.26 MiB (69%)
Title : ISO Media file produced by Google Inc.
Writing library : XviD 69
So as you can see technically it is also MPEG-4. Totem identifies this second video as MPEG-4.
Second video is playable on my phone.
My question is how can I make/encode my own 3gp video with "jpeg" video codec?
Chipset of my phone is sc6531e (datasheet is avaliable in internet)
I have figured it out, it is just Apple Quicktime MJPEG codec. It is not compatibile with 3GP container, it is intended to work with MOV. My phone just changes few bytes in header and makes it look like 3GP although it is MOV. Here are the specs:
https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFPreface/qtffPreface.html.

Pillow : return a NoneType when extracting EXIF ​metadata

I tried to extract Exif metadata from a picture with Pillow.
When I import my picture on GIMP or XnView, the software returns to me Exif metadata :
EXIF metadata on GIMP
However, when I run my Python script like this :
from PIL import Image
from PIL.ExifTags import TAGS
def get_exif():
i = Image.open('./Datatest_img/DAFANCH96_023MIC07633_L.jpg')
info = i._getexif()
return {TAGS.get(tag): value for tag, value in info.items()}
print(get_exif())
the script returns to me an error as if the image did not contain EXIF ​​metadata :
Traceback (most recent call last):
File "test_exif.py", line 17, in <module>
print(get_exif())
File "test_exif.py", line 15, in get_exif
return {TAGS.get(tag): value for tag, value in info.items()}
AttributeError: 'NoneType' object has no attribute 'items'
I also tried printing .info in my script the code return :
{None: (200, 200)}
and I running exiftool in command Line, the terminal print :
$ exiftool DAFANCH96_023MIC07633_L.jpg
ExifTool Version Number : 11.99
File Name : DAFANCH96_023MIC07633_L.jpg
Directory : .
File Size : 791 kB
File Modification Date/Time : 2020:05:27 22:46:56+02:00
File Access Date/Time : 2020:05:28 10:54:31+02:00
File Inode Change Date/Time : 2020:05:27 22:46:57+02:00
File Permissions : rw-r--r--
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
JFIF Version : 1.01
Resolution Unit : inches
X Resolution : 200
Y Resolution : 200
Image Width : 4096
Image Height : 2944
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 1
Image Size : 4096x2944
Megapixels : 12.1
Anyone have an idea ? Does anyone know what's going on ? thanks.

FFMPEG Cutting Commercials puts audio out of sync

Ubuntu 14.04.1 with the real ffmpeg loaded (same problem with the avconv version).
I'm trying to take files created in MythTV with a HDPVR, cut the commercials and put the video into an MP4 container for use with MythRoku.
the command
ffmpeg -i $file -acodec copy -vcodec copy -f mp4 file.mp4
Works fine. Once I update the database, I can watch the file in MythRoku or Plex.
However, when I try to cut out the commercials, the audio gets out of sync by just over 1 second (audio delayed) whenever I cut past the 0 mark. Totem Video player and VLC both play the resulting video fine, but I can see a "hitch" at the beginning while they are syncing the audio, so I know the information on the audio sync is in the file somewhere. Mythroku and Plex both are out of sync when playing the file. The MythTV Frontend player actually does play it correctly, and I can hear the "hitch" as it syncs the audio.
After hours of reading posts and playing with settings, I've got it down to this:
If I say:
ffmpeg -i $file -acodec copy -vcodec copy -f mp4 -ss 0 -t <anything> out.mp4
The file is fine, plays both locally and in MythRoku/Plex
But if I advance the start any amount - even 1 second - audio is out of sync
ffmpeg -i $file -acodec copy -vcodec copy -f mp4 -ss 1 -t <anything> out.mp4
I've tried splitting the video (as mp4) and audio (as ac3) first, splitting them separately, and then putting them back together as the last step, but I get the same results.
The information is in the file - Totem, VLC and the Frontend all can figure it out. How can I get ffmpeg to figure out the sync and write the file so it's correct?
Original file:
mythtv#marvin:~$ mediainfo /var/lib/mythtv/recordings/2225_20140824001500.mpg
General
ID : 0 (0x0)
Complete name : /var/lib/mythtv/recordings/2225_20140824001500.mpg
Format : MPEG-TS
File size : 4.03 GiB
Duration : 1h 45mn
Overall bit rate mode : Variable
Overall bit rate : 5 491 Kbps
Video
ID : 4113 (0x1011)
Menu ID : 1 (0x1)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main#L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=4, N=32
Codec ID : 27
Duration : 1h 45mn
Bit rate mode : Variable
Bit rate : 4 831 Kbps
Maximum bit rate : 20.0 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate : 59.940 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.087
Stream size : 3.55 GiB (88%)
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio
ID : 4352 (0x1100)
Menu ID : 1 (0x1)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : 129
Duration : 1h 45mn
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -6ms
Stream size : 289 MiB (7%)
File cut from 0:
mythtv#marvin:~$ mediainfo 2225_20140824001500_1.mp4
General
Complete name : 2225_20140824001500_1.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 58.5 MiB
Duration : 1mn 45s
Overall bit rate mode : Variable
Overall bit rate : 4 676 Kbps
Writing application : Lavf54.63.104
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main#L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=4, N=32
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 45s
Bit rate mode : Variable
Bit rate : 4 281 Kbps
Maximum bit rate : 20.0 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 59.940 fps
Minimum frame rate : 59.920 fps
Maximum frame rate : 59.960 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.077
Stream size : 53.6 MiB (92%)
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : ac-3
Duration : 1mn 45s
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 4.81 MiB (8%)
File cut from 1 second with audio sync problem:
mythtv#marvin:~$ mediainfo 2225_20140824001500_2.mp4
General
Complete name : 2225_20140824001500_2.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 68.0 MiB
Duration : 2mn 0s
Overall bit rate mode : Variable
Overall bit rate : 4 750 Kbps
Writing application : Lavf54.63.104
Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main#L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=4, N=32
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1mn 58s
Bit rate mode : Variable
Bit rate : 4 394 Kbps
Maximum bit rate : 20.0 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16:9
Frame rate mode : Variable
Frame rate : 59.940 fps
Minimum frame rate : 59.920 fps
Maximum frame rate : 59.960 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.080
Stream size : 62.3 MiB (92%)
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.709
Audio
ID : 2
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Codec ID : ac-3
Duration : 2mn 0s
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Stream size : 5.49 MiB (8%)

Resources